San*_*osh 3 android actionbarsherlock drop-down-menu android-styles
以下是我如何更改sherlock actionbar overflow-dropdown菜单的背景颜色.如何更改下拉项目文本颜色和重力?请帮我.目前文字颜色为黑色.
<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>
Run Code Online (Sandbox Code Playgroud)
终于以这种方式解决了.但是,我没有测试对ActionBar上其他小部件的影响:
<item name="android:actionBarWidgetTheme">@style/CustomActionOverflowDropDownText</item>
<item name="actionBarWidgetTheme">@style/CustomActionOverflowDropDownText</item>
Run Code Online (Sandbox Code Playgroud)
和
<style name="CustomActionOverflowDropDownText" parent="Widget">
<item name="android:textColor">@color/app_bg_color</item>
<item name="android:gravity">right</item>
</style>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2080 次 |
| 最近记录: |