Reputation: 5016
Here is how I'm changing the background color of sherlock actionbar overflow-dropdown menu. How can I change the dropdown item text color and gravity? Please help me. Currently the text color is black.
<style name="AppBaseTheme" parent="@style/Theme.Sherlock.Light.ForceOverflow">
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:actionOverflowButtonStyle">@style/CustomActionOverFlowStyle</item>
<item name="actionOverflowButtonStyle">@style/CustomActionOverFlowStyle</item>
<item name="actionButtonStyle">@style/CustomActionButtonStyle</item>
<item name="android:actionButtonStyle">@style/CustomActionButtonStyle</item>
<item name="android:dropDownListViewStyle">@style/CustomDropDownListView</item>
<item name="dropDownListViewStyle">@style/CustomDropDownListView</item>
</style>
<style name="CustomDropDownListView" parent="android:style/Widget.Holo.ListView.DropDown">
<item name="android:background">@color/abs__bright_foreground_disabled_holo_dark</item> <!-- this works -->
<item name="android:textColor">@color/white</item> <!-- but this is not working -->
<item name="android:divider">@color/app_bg_color</item>
<item name="android:dividerHeight">0.5dp</item>
<item name="android:dividerPadding">1dp</item>
<item name="android:gravity">right</item>
</style>
Upvotes: 3
Views: 2094
Reputation: 5016
Finally solved in this way. However, I didn't test impact on other widgets on ActionBar:
<item name="android:actionBarWidgetTheme">@style/CustomActionOverflowDropDownText</item>
<item name="actionBarWidgetTheme">@style/CustomActionOverflowDropDownText</item>
and
<style name="CustomActionOverflowDropDownText" parent="Widget">
<item name="android:textColor">@color/app_bg_color</item>
<item name="android:gravity">right</item>
</style>
Upvotes: 5