关于Android 应用 Button 文本默认大写显示问题

问题

   关于在高版本Android应用中Button的文本,如果是字母,默认全部显示为大写。

问题分析

   由于Android 5.0 以后版本ButtontextAllCaps 属性默认设置为true,导致字母文本都显示为大写。

   而Android 5.0 以前的版本,该配置仍为false,故不存在以上问题。

解决方案

   通过以上分析,只要将对应ButtontextAllCaps 属性配置修改为false即可。

  1. Button所在的xml布局中添加以下配置,将默认值修改过来。
 android:textAllCaps="false" 
  1. 通过代码修改该配置。
button.setAllCaps(false);

猜你喜欢

转载自blog.csdn.net/qq_22255311/article/details/129715037
今日推荐