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"/>
相关推荐
小比卡丘2 小时前
C语言进阶版第17课—自定义类型:联合和枚举
android·java·c语言
前行的小黑炭3 小时前
一篇搞定Android 实现扫码支付:如何对接海外的第三方支付;项目中的真实经验分享;如何高效对接,高效开发
android
落落落sss4 小时前
MybatisPlus
android·java·开发语言·spring·tomcat·rabbitmq·mybatis
代码敲上天.5 小时前
数据库语句优化
android·数据库·adb
GEEKVIP7 小时前
手机使用技巧:8 个 Android 锁屏移除工具 [解锁 Android]
android·macos·ios·智能手机·电脑·手机·iphone
model20059 小时前
android + tflite 分类APP开发-2
android·分类·tflite
彭于晏6899 小时前
Android广播
android·java·开发语言
与衫10 小时前
掌握嵌套子查询:复杂 SQL 中 * 列的准确表列关系
android·javascript·sql
500了16 小时前
Kotlin基本知识
android·开发语言·kotlin
人工智能的苟富贵17 小时前
Android Debug Bridge(ADB)完全指南
android·adb