How to set dropdown arrow in spinner?

前端 未结 10 821
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 14:40

I tried to set spinner with drop down arrow but i couldn\'t fix it can anyone help me with this? I have attached the source code.

my class file:

             


        
10条回答
  •  忘掉有多难
    2020-11-27 14:52

    Basically one needs to create a custom background for a spinner. It should be something like this:

    spinner_background.xml

    
    
        
    
            
    
                
                    
                
    
                
                    
                
    
            
    
        
    
    
    

    Then create a custom style for your spinner, where you specify the above selector as background:

    
    

    And finally in your app theme you should override two attributes if you want it to be applied all across your app:

    @style/Widget.App.Spinner
    @style/Widget.App.Spinner
    

    And that's pretty much it.

提交回复
热议问题