Why is my Button text forced to ALL CAPS on Lollipop?
I don't have idea why it is happening but there 3 trivial attempts to make:
Use
android:textAllCaps="false"
in yourlayout-v21
Programmatically change the transformation method of the button.
mButton.setTransformationMethod(null);
Check your style for Allcaps
Note: public void setAllCaps(boolean allCaps)
, android:textAllCaps
are available from API version 14.
Here's what I did in my values/themes.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="buttonStyle">@style/MyButton</item> </style> <style name="MyButton" parent="Widget.AppCompat.Button"> <item name="android:textAllCaps">false</item> </style>
This is fixable in the application code by setting the button's TransformationMethod, e.g.
mButton.setTransformationMethod(null);