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"/>
相关推荐
刮风那天14 分钟前
Android Framework 核心架构图
android
__Witheart__17 分钟前
3588 安卓编译空间不足报错
android
aaajj37 分钟前
【Android】手机屏幕劫持防护
android·智能手机
写做四月一日的四月一日1 小时前
在安卓手机上安装小龙虾openclaw并配置QQ机器人接入
android·人工智能
流星白龙1 小时前
【MySQL高阶】6.MySQL数据目录,日志
android·mysql·adb
福大大架构师每日一题1 小时前
rust 1.96.0 更新:语言、编译器、Cargo、Rustdoc、兼容性全面升级,必看完整解读
android·开发语言·rust
城管不管1 小时前
Agent——001
android·java·数据库·llm·prompt
刮风那天2 小时前
Android 理解onTransitionReady(一)
android
流星白龙2 小时前
【MySQL高阶】2.MySQL命令行客户端(2)
android·mysql·adb
努力努力再努力wz2 小时前
【Qt入门系列】:QLabel控件详解:从文本显示到图片展示,再到内容布局与伙伴机制
android·开发语言·数据结构·数据库·c++·qt·mysql