ActionBarSherlock硬键菜单面板文本颜色(ActionBarSherlock hard

2019-08-07 02:21发布

我有我的主题化的应用程序,使用ActionBarSherlock一个小问题。 除了在一切正常Samsung phones with TouchWizz 。 溢出菜单项出现按硬件菜单键。

我知道如何更改面板的背景。 我的默认主题延伸Theme.Sherlock.Light.DarkActionBar ,所以在硬件面板中的默认菜单项的文字颜色将是black ,我wan't改变这一点。

如何做到这一点,除了改变了我的默认主题的父任何想法?

<style name="Theme.MyApp" parent="@style/Theme.Sherlock.Light.DarkActionBar">
    <item name="android:panelBackground">@drawable/menu_hardkey_panel</item>
</style>

Answer 1:

下面是正确的attrs调整硬件的菜单风格。 你应该看看panelColorForeground ;-)

<item name="android:panelColorBackground">#FFFFFF</item>
<item name="android:panelColorForeground">@color/primary_text_holo_dark</item>
<item name="android:panelFullBackground">@drawable/menu_background_fill_parent_width_holo_dark</item>
<item name="android:panelTextAppearance">@style/Holo.TextAppearance</item>

测试在HoloEverywhere lib和2.3模拟器。 见ATTRS文档的详细信息。



Answer 2:

我不知道如果我理解你想要做什么,但如果你想改变文字颜色在这个面板,您可以创建父组到TextAppearance.Sherlock.Widget.PopupMenu自定义样式,然后改变文字颜色属性。 像这样:

<style name="Widget.MyApp.ActionBarPopupLargeTextColor" parent="TextAppearance.Sherlock.Widget.PopupMenu.Large">
<item name="android:textColor">@color/black</item>
</style>

<style name="Widget.MyApp.ActionBarPopupSmallTextColor" parent="TextAppearance.Sherlock.Widget.PopupMenu.Small">
    <item name="android:textColor">@color/black</item>
</style>

为我工作:)



文章来源: ActionBarSherlock hardkey menu panel text color