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"/>
相关推荐
等风来不如迎风去12 小时前
【android】oppo手机拷贝视频文件
android·windows·智能手机
悠哉清闲13 小时前
android studio中怎么引用SVG
android·android studio
TheNextByte113 小时前
在小米上检索照片/视频的5种方法
android
我命由我1234513 小时前
JUnit - 自定义 Rule
android·java·开发语言·数据库·junit·java-ee·android-studio
2501_9159214313 小时前
在没有源码的前提下,怎么对 Swift 做混淆,IPA 混淆
android·开发语言·ios·小程序·uni-app·iphone·swift
00后程序员张1 天前
对比 Ipa Guard 与 Swift Shield 在 iOS 应用安全处理中的使用差异
android·开发语言·ios·小程序·uni-app·iphone·swift
悠哉清闲1 天前
不同车型drawable不同
android·开发语言
00后程序员张1 天前
在 iOS 设备上同时监控 CPU、GPU 与内存的方法
android·ios·小程序·https·uni-app·iphone·webview
测试_AI_一辰1 天前
项目实践笔记 9:打卡/日报Agent项目Bug 修改与稳定性收口(v1.0)
android·开发语言·人工智能·功能测试·ai编程·ab测试
马 孔 多 在下雨1 天前
Kotlin协程进阶王炸之作-Kotlin的协程到底是什么
android·开发语言·kotlin