3

这是我如何更改夏洛克操作栏溢出下拉菜单的背景颜色。如何更改下拉项文本颜色和重力?请帮我。当前文本颜色为黑色。在此处输入图像描述

<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>
4

1 回答 1

5

终于以这种方式解决了。但是,我没有测试对 ActionBar 上其他小部件的影响:

<item name="android:actionBarWidgetTheme">@style/CustomActionOverflowDropDownText</item>
<item name="actionBarWidgetTheme">@style/CustomActionOverflowDropDownText</item>

<style name="CustomActionOverflowDropDownText" parent="Widget">
    <item name="android:textColor">@color/app_bg_color</item>
    <item name="android:gravity">right</item>
</style>
于 2013-09-26T08:58:19.960 回答