Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBarSherlock NAVIGATION_MODE_LIST textcolor

I am using ActionBarSherlock as follows:

Context context = getSupportActionBar().getThemedContext();
ArrayAdapter<CharSequence> list = ArrayAdapter.createFromResource(
        context, R.array.dropdown, R.layout.sherlock_spinner_item);
list.setDropDownViewResource(R.layout.sherlock_spinner_dropdown_item);

getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
getSupportActionBar().setListNavigationCallbacks(list, this);

However, I cannot figure out how to style the textcolor of the selected item in the dropdown. My styles file looks like:

<style name="MyTheme.ActionBar.TitleTextStyle" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
    <item name="android:textColor">#ABABAB</item>
</style>

But this only affects the title text, not that of the spinner.

Any ideas of the attribute I need to override?

Thanks,

Stephen

like image 579
steprobe Avatar asked Dec 12 '25 20:12

steprobe


1 Answers

You must edit the Style at the sherlock library : res/values/abs_string.xml

<style name="Sherlock.__Widget.Holo.DropDownItem" parent="Widget">
  <item name="android:textAppearance">@style/TextAppearance.Sherlock.Widget.DropDownItem‌​</item>
  <item name="android:paddingLeft">8dp</item>
  <item name="android:paddingRight">8dp</item>
  <item name="android:gravity">center_vertical</item>
like image 191
Maulana Avatar answered Dec 14 '25 09:12

Maulana