I am working with ActionBar menuitem action-help, it is visible always in UPPERCASE latters but I needs to show in LOWERCASE latters.
有很多关于操作栏样式的问题,但我发现的问题要么与 MenuItems 文本的样式有关,要么有对我不起作用的答案。
这个问题真的很简单。我希望能够更改操作栏中菜单项的文本样式(甚至只是颜色或小写)。
还有这个问题:Style an Action Bar in Android
我从中整理了一个测试应用程序,我用它来尝试更改菜单项。它使用在 android studio android 插件中创建的应用程序的所有默认值,以下除外。
my v21\styles.xml look like
here is the code used for my AppTheme (make styles) used..
my Base Theme
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:colorPrimaryDark" tools:targetApi="lollipop">@color/colorPrimaryDark</item>
<item name="android:colorAccent" tools:targetApi="lollipop">@color/colorAccent</item>
<item name="android:colorBackground">@color/background_material_light</item>
<item name="android:windowBackground">@color/windowBackground</item>
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="android:actionMenuTextAppearance">@style/MyMenuTextAppearance</item>
</style>
<style name="MyMenuTextAppearance" parent="android:TextAppearance.Holo.Widget.ActionBar.Menu">
<item name="android:textAllCaps">false</item>
</style>
<style name="MyActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:titleTextStyle">@style/MyActionBar.TitleTextStyle</item>
<item name="android:actionMenuTextAppearance">@style/MyActionBar.MenuTextStyle</item>
</style>
<style name="MyActionBar.TitleTextStyle"
parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#F0F</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">24dip</item>
</style>
<style name="MyActionBar.MenuTextStyle"
parent="android:style/TextAppearance.Holo.Widget.ActionBar.Menu">
<item name="android:textColor">#F0F</item>
<item name="android:textStyle">bold</item>
<item name="android:textSize">24dip</item>
</style>