How to change spinner background color?

末鹿安然 提交于 2019-12-11 08:27:08

问题


I have prepared custom spinner with text color and text size using adapter.By default spinner background color while ,here i want to change white to some other color or image?

Is there any change to change backgroung color of spinner?. Please help me


回答1:


<Spinner android:id="@+id/spinner"
         ...
         android:background="#YOUR_HEXA_COLOR"/>

This didn't work for you?

Else if you are using a custom Spinner you can have it from this Blog.




回答2:


I made my custom spinner by totally write a new view.(A LinearLayout contains several item) When click the "Spinner Button" I add the custom view to the screen, just pretend to be a spinner, then I can do a lot of custom things on it. :)



来源:https://stackoverflow.com/questions/8831477/how-to-change-spinner-background-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!