I want to make MenuItem title in the ActionBar to LowerCase.
my menu.xml
<item android:id="@+id/register"
android:title="Register"
android:showAsAction="ifRoom|withText"/>
<item android:id="@+id/unregister"
android:title="Unregister"
android:showAsAction="ifRoom|withText"/>
On the ActionBar it sees "REGISTER" and "UNREGISTER", but I want that it sees as "Register" and "Unregister".
Is it possible to make first letter upper and next letters lower at MenuItem? And how I can do that?
Add the following to one of your values xml files -
For making the menu text to lowercase like "MENU ITEM" to "Menu Item" here is my solution.
In res >> values >> styles.xml add the following:
After you can call it on your AppTheme:
I hope this helps. :)
From source code in android.support.v7.internal.view.menu.ListMenuItemView
In project: Create popup theme and apply it on popup creation for some custom popup if it's planned to use this appearance across whole application then put it to main application theme.
add theme to toolbar with textAllCaps
styles.xml
I tried some of the other answers here but to no luck (I'm not using action bar sherlock). As mentioned in the comments, in the newer support libraries, the above solutions don't seem to work. To solve this issue, I added my own actionLayout to the Menu Items.
Then in my code I did something like this.
Then you can do what you want with the text view and avoid the text being all caps. This is definitely not ideal, but if you need a workaround for this issue, this does work.
Solution for native ActionBar implementation:
If you are using ActionBarSherlock there are two different approaches:
1) Create boolean resource
abs__config_actionMenuItemAllCaps
and set it tofalse
:2) Or create theme with overriden
actionMenuTextAppearance
and use it inAndroidManifest.xml
:PLEASE NOTE: there is bug in ActionBarSherlock that forces MenuItem to be upper case on pre-ICS (https://github.com/JakeWharton/ActionBarSherlock/issues/969). I've submitted patch but it is not merged at the moment. For now you can use my fork: https://github.com/alexander-mironov/ActionBarSherlock/tree/dev, I will update this answer when my code is merged in the main repository.UPDATE: my fix has been merged into main ActionBarSherlock repository.