android:text 总为大写字母的原因

当设置某个 Button 的 text 为英文时,界面上显示的是该英文的大写形式(uppercase)。例如:

XML 复制代码
<Button
    android:id="@+id/btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello"/>

Button 显示的文本为:

HELLO

经查询,一般原因是 textAllCaps 属性被设置为 true。因此,只要将该属性设置为 false 即可。

XML 复制代码
<Button
    android:id="@+id/btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello"
    android:textAllCaps="false"/>
相关推荐
CHINAHEAO11 分钟前
Bagisto单独将后台设置成中文
android
E***U94528 分钟前
React Native开发
android·react native·react.js
4***99741 小时前
Kotlin序列处理
android·开发语言·kotlin
t***D2641 小时前
Kotlin在服务端开发中的生态建设
android·开发语言·kotlin
玲珑Felone2 小时前
flutter 状态管理--InheritedWidget、Provider原理解析
android·flutter·ios
BoomHe2 小时前
车载应用配置系统签名
android·android studio
路人甲ing..4 小时前
用 Android Studio 自带的模拟 Android Emulator 调试
android·java·ide·ubuntu·kotlin·android studio
路人甲ing..4 小时前
Android Studio 模拟器报错 The emulator process for AVD xxxxx has terminated.
android·java·ide·kotlin·android studio
弥巷4 小时前
【Android】 View事件分发机制源码分析
android·java
wanna5 小时前
安卓自学小笔记第一弹
android·笔记