I'm trying to style the action bar list navigation such that it has white text in the closed state. When I've done that, though, it has turned all the text white, which doesn't work with the white dropdown.
Is there a way to style each individually? The docs are non-existant :(
Probably, you can do it programmatically (though I never tried it):
If you use an
Adapter
(which must by definition implementSpinnerAdapter
) you have two callbacks that you can override.getView
will be called for the "selected" item.getDropDownView
will get called for the drop-down items. You can set your different text colors there.Add Custom Layout for your
Adapter
. in this i have created one layout inside that i have add oneTextView
. withtext color
andbackground color
.and set atapter like:
here
R.layout.my_spinner_style
is my custom layout.R.id.textView1
is textview id frommy_spinner_style.xml
.you can also applay your awn style inside TextView. check this and this aretical.
check this code:
inside
onCreate
:my_spinner_style.xml