How to create custom spinner like border around the spinner with down triangle on the right side?

前端 未结 7 2063
死守一世寂寞
死守一世寂寞 2020-11-30 18:33

I want to develop custom spinner like line around spinner with triangle at right bottom corner.
like following image

7条回答
  •  离开以前
    2020-11-30 19:02

    You can achieve the following by using a single line in your spinner declaration in XML:

    Just add this: style="@android:style/Widget.Holo.Light.Spinner"

    This is a default generated style in android. It doesn't contain borders around it though. For that you'd better search something on google.

    Hope this helps.

    UPDATE: AFter a lot of digging I got something which works well for introducing border around spinner.

    
    
        
            
                
                
                
                
            
        
    
    

    Place this in the drawable folder and use it as a background for spinner. Like this:

    
    
            
    
        
    

提交回复
热议问题