After I set action bar
to NAVIGATION_MODE_LIST
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
and then set an adapter for it.
The list show up as expected, but I need to change the 'little triangle' color of the list as the default color is very close to my background color.
Is it possible to do this, if so, how can I do it?
The little triangle you want to change is in the background of a
Spinner
widget inActionBar
. The background is a state list drawable. Items of the state list drawable are 9-patch drawables like this one (this particular one is the hdpi version for default state for Holo light theme):To change the color of the triangle you have to change few sets of these 9-patch drawables - one drawable for each dpi and combination of states. You'll also need custom state list drawable to be as as the background of the
Spinner
widget.To change the widget background you have to adjust the theme. If you are using ActionBarSherlock (ABS) change
actionDropDownStyle
item and for native ActionBar changeandroid:actionDropDownStyle
item (even if you use ABS native ActionBar is used for devices running Android 4.0 and higher).The theme should be something like:
And
MyActionBarSpinnerStyle
should be something like:Where instead of
MyDropDownActionBarStyle
there should be something likeWidget.Sherlock.Light.Spinner.DropDown.ActionBar
if you use ABS orWidget.Holo.Light.Spinner.DropDown.ActionBar
if you target only native ActionBar.