Hi I want to change the background color of Android spinner prompt or title, not the background color of Spinner List item.
So far I have not yet found any effective way to do it.
Thanks.
Related
I am trying to customize the color of time picker spinner divider of Android watch app.
I have tried using the customized style elements. But the divider color is not changing. Can anyone help me please???
Is there a way to read current theme colors from code ?
I want to
1. Read disabled Button color and put it as EditText background
2. Read Spinner selected item color and put it as TextView background
Read disabled Button color and put it as EditText background
Disabled is not a color. It is a state of a StateListDrawable that is used for the button background. Hence, you cannot "read disabled Button color", because there is no simple color for "disabled".
Read Spinner selected item color and put it as TextView background
The selected item in a Spinner has no specific color, as so therefore I have no idea what color you might mean here.
How do I adjust Spinner dialog style?
All I want to do is to change the background, either to drawable or a color.
If you want change the spinner's popup background, you can use : setPopupBackgroundResource()
For change background of the spinner (not the popup), this tutorial are good -> link
I want to implement the below:
A spinner which would have a custom layout, its background color would be black and font would be white. But what I want is that when I select any component then my selection background and font color should reverted back to its defaults (in terms of color).
#Rao use custom Spinner and for colour state change use Color State list
I want to change the menu item background beacuse I use black icons, but on some phones the default color of background is black or other dark color. I tried this solution and it's worked but there was a little problen with it:
I have ten items and that's why I have a "More" item to show other options, but if I choose the More item (which is got the custom background) and after that I press back button, the item will be in the default state, default colors. What is the solution? Thanks!
The style attribute for the menu background is android:panelFullBackground. It's not hackish like the other solution, so it's not as buggy.
Despite what the documentation says, it needs to be a resource (e.g. #android:color/black or #drawable/my_drawable), it will crash if you use a color value directly.
try to use android own menu icon like as setIcon(android.R.drawable.ic_menu_search)