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"/>
相关推荐
5***g29814 分钟前
MySQL 数据库连接池爆满问题排查与解决
android·数据库·mysql
牛奔21 分钟前
php 8.2 配置安装php-zbarcode扩展
android·开发语言·php
hudawei99642 分钟前
kotlin协程编译成Android字节码后是什么样的
android·开发语言·kotlin
2501_915106321 小时前
iOS 抓不到包怎么办?从 HTTPS 代理排查到 TCP 数据流捕获的全链路解决方案
android·tcp/ip·ios·小程序·https·uni-app·iphone
游戏开发爱好者81 小时前
APP上架苹果应用商店经验教训与注意事项
android·ios·小程序·https·uni-app·iphone·webview
s***35301 小时前
【MySQL】MySQL用户管理
android·mysql·adb
QING6181 小时前
kotlin 协程: GlobalScope 和 Application Scope 选择和使用 —— 新手指南
android·kotlin·android jetpack
霸王大陆1 小时前
《零基础学 PHP:从入门到实战》教程-模块四:数组与函数-2
android·开发语言·php
v***43171 小时前
springboot3整合knife4j详细版,包会!(不带swagger2玩)
android·前端·后端
h***04772 小时前
MySQL 的 INSERT(插入数据)详解
android·数据库·mysql