概述
大家应该有发现,每次写一个Button的时候,英文文本总是会变成大写

解决办法
只要设置属性textAllCaps
为false,就可以解决了
1 | android:textAllCaps="false" |
好奇宝宝
点进Button的源码,可以发现textAllCaps
默认就是false,那么问题来了,为什么既然是false,仍然还需要另外设置?

深入探索
1.AppCompat主题会把Button自动转为AppCompatButton,先从这里找线索;
2.直接进入AppCompat的styles.xml
,先直接搜索textAllCaps
看有没有结果,结果出来一个Button的样式,而这里textAllCaps的值就是true;

3.看到这个是不是拍着大腿,感觉好像明白了什么
结论
在AppCompat
下Button的textAllCaps
默认值就是true
Related Issues not found
Please contact @xiandanin to initialize the comment