安卓主题Theme.AppCompat中,在5.0以上的API的时候,Button的默认属性是字母全部大写(不知道谷歌咋想的)。
查了一下,原来这Button字母默认大写是Material Design Theme的样式(5.0以上默认样式),而AppCompat Theme是用于兼容5.0以下手机显示Material Design Theme用的。
这就能解释,AppCompat Theme为什么在5.0以下API不会字母全部大写,而5.0以上就会全部大写,因为5.0以上就兼容Material Design Theme。
所以解决方法就是,
1、换个非Material Design主题,
2、使用5.0以下的API,则不会有这个问题。
3、在Button里增加属性:
android:textAllCaps="false"(关闭全部大写属性)