我在我的应用程序中使用 Theme.Holo。
我使用以下 Style.xml 自定义了我的主题
<style name="CustomActivityTheme" parent="@android:style/Theme.Holo">
<item name="android:actionBarStyle">@style/CustomActivityTheme.ActionBar</item>
<item name="android:actionMenuTextColor">#000000</item>
<item name="android:divider">@drawable/action_bar_div</item>
<item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
<item name="android:popupMenuStyle">@style/MyPopupMenu</item>
<item name="android:itemBackground">@drawable/menu_item_background_fill</item>
<item name="android:itemTextAppearance">@style/myCustomMenuTextApearance</item>
</style>
<style name="myCustomMenuTextApearance" parent="@android:style/TextAppearance.Widget.TextView.PopupMenu">
<item name="android:textColor">#404040</item>
</style>
<style name="CustomActivityTheme.ActionBar.OverFlow" parent="@android:style/TextAppearance">
<item name="android:textColor">#404040</item>
<item name="android:textSize">18sp</item>
</style>
<style name="CustomButton">
<item name="android:background">@drawable/button_selector</item>
</style>
<style name="CustomProgressButton">
<item name="android:background">@drawable/custom_progress_button</item>
</style>
<style name="CustomProfileButton">
<item name="android:background">@drawable/custom_profile_button</item>
</style>
<style name="CustomSharingButton">
<item name="android:background">@drawable/custom_sharing_button</item>
</style>
<style name="CustomListBlue">
<item name="android:background">@drawable/custom_listblue</item>
</style>
<style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow">
<!-- <item name="android:background">#B2B2B2</item> -->
<item name="android:popupBackground">#B2B2B2</item>
</style>
<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.ActionButton.Overflow">
<item name="android:src">@drawable/overflow</item>
</style>
<style name="CustomActivityTheme.ActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">@drawable/actionbar_bg</item>
<item name="android:titleTextStyle">@style/CustomActivityTheme.ActionBar.Text</item>
<item name="android:subtitleTextStyle">@style/CustomActivityTheme.ActionBar.Text</item>
<!-- <item name="android:actionOverflowButtonStyle">@drawable/overflow.png</item> -->
</style>
<style name="CustomActivityTheme.ActionBar.Text" parent="@android:style/TextAppearance">
<item name="android:textColor">#000000</item>
<item name="android:textSize">16sp</item>
</style>
<style name="activated" parent="android:Theme.Holo">
<item name="android:background">?android:attr/activatedBackgroundIndicator</item>
</style>
<!-- style for removing the floating dialog -->
<style name="CustomDialogTheme">
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
</style>
<!-- style for transparent image resource activity -->
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowAnimationStyle">@style/MyAnimation.Window</item>
</style>
<!-- Animations for a non-full-screen window or activity. -->
<style name="MyAnimation.Window" parent="@android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">@anim/grow_from_middle</item>
<item name="android:windowExitAnimation">@anim/shrink_to_middle</item>
</style>
<!-- style for transparent audio and video resource activity -->
<style name="Theme.Transparent_Player" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowAnimationStyle">@style/MyPlayerAnimation.Window</item>
</style>
<!-- Animations for a non-full-screen window or activity. -->
<style name="MyPlayerAnimation.Window" parent="@android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">@anim/grow_from_action_bar</item>
<item name="android:windowExitAnimation">@anim/shrink_to_action_bar</item>
</style>
我在 10 英寸设备中的输出低于
在 4.7 英寸设备中,它显示输出(如果 #404040 颜色代码,则使用白色文本颜色)
在这里,我可以设置背景颜色,但菜单项文本颜色在 4.7 英寸设备中没有改变
在 4.7 英寸设备中,我没有溢出菜单图标,我通过按菜单按钮打开此菜单。
如何设置文本颜色与 10 英寸设备相同?
提前谢谢!!!
我的菜单布局代码是:
<item
android:id="@+id/home"
android:title="@string/home"/>
<item
android:id="@+id/viewer"
android:title="@string/viewer"/>
<item
android:id="@+id/quiz"
android:title="@string/quiz"/>
<item
android:id="@+id/results"
android:title="@string/results"/>
<item
android:id="@+id/chat"
android:title="@string/chat"/>
<item
android:id="@+id/settings"
android:title="@string/settings"/>
<item
android:id="@+id/intro"
android:title="@string/intro"/>
<item
android:id="@+id/lookitup"
android:title="@string/lookitup"/>
<item
android:id="@+id/standing"
android:title="@string/standing"/>
<item
android:id="@+id/sharing"
android:title="@string/sharing"/>
<item
android:id="@+id/advance"
android:title="@string/advance"/>
<item
android:id="@+id/reset"
android:title="@string/reset"/>
<item
android:id="@+id/refresh"
android:title="@string/refresh"/>
<item
android:id="@+id/sync_now"
android:title="@string/sync_now"/>
<item
android:id="@+id/sync_info"
android:title="@string/sync_info"/>
<item
android:id="@+id/menuIconInfo"
android:icon="@drawable/info_light_on_dark"
android:showAsAction="always"/>
<item
android:id="@+id/menuIconAudio"
android:icon="@drawable/audio_light_on_dark"
android:showAsAction="always"/>
<item
android:id="@+id/menuIconVideo"
android:icon="@drawable/video_light_on_dark"
android:showAsAction="always"/>
<item
android:id="@+id/menuIconLearn"
android:icon="@drawable/ic_menu_learn"
android:showAsAction="always"/>
<item
android:id="@+id/menuIconIntro"
android:icon="@drawable/intro_pane"
android:showAsAction="always"/>
<item
android:id="@+id/menuIconLookItUp"
android:icon="@drawable/look_it_up"
android:showAsAction="always"/>
<item
android:id="@+id/menuIconRecall"
android:icon="@drawable/ic_menu_recall"
android:showAsAction="always"/>