Uppercase action bar menu item text

I have a menu item in my action panel that displays only the text of the item - not the icon. And everything is in order, but somehow the name of the element occurs in uppercase. Can anyone tell me how I can return it as defined. Here is the xml menu I have:

 <?xml version="1.0" encoding="utf-8"?>
    <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" >

        <item
            android:id="@+id/action_download"
            android:orderInCategory="99"
            app:showAsAction="always|withText"
            android:title="Download"/>

    </menu>

and I get the item displayed as DOWNLOADinsteadDOWNLOAD

+4
source share
3 answers

It helped me (I am using AppCompat)

<item name="actionButtonStyle">@style/AppTheme.Widget.ActionButton</item>

<style name="AppTheme.Widget.ActionButton" parent="@style/Widget.AppCompat.ActionButton">
    <item name="textAllCaps">false</item>
</style>
+22
source

You redefined the theme and set your own style for the action bar menu items.

    <?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="YourTheme" parent="android:Theme.Holo">
        <item name="android:actionMenuTextAppearance">@style/LowerCaseMenuTextAppearance</item>
    </style>
    <style name="LowerCaseMenuTextAppearance" parent="android:TextAppearance.Holo.Widget.ActionBar.Menu">
        <item name="android:textAllCaps">false</item>
    </style>
</resources>
+4
source

Android

, .

android:capitalize="none"

, .

+2
source

Source: https://habr.com/ru/post/1589271/


All Articles