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"/>
相关推荐
冬奇Lab10 分钟前
Android系统核心服务协作:从点击图标到应用显示的完整链路
android·源码阅读
fengci.14 分钟前
ISCTF2021
android
ego.iblacat26 分钟前
在 LNMP 平台中部署 Web 应用
android·前端·adb
一起搞IT吧38 分钟前
Android功耗系列专题理论之十五:相机camera功耗问题分析方法
android·c++·数码相机·智能手机·性能优化
tntlbb42 分钟前
苍穹外卖Day1:项目数据库连接问题排查与原理分析报告
android·adb
这个Bug有点难搞1 小时前
Android开发 JNI-调用第三方so库
android
2501_915106322 小时前
如何在 Mac 上面代理抓包和数据流分析
android·macos·ios·小程序·uni-app·iphone·webview
诸神黄昏EX2 小时前
Android Safety 系列专题【篇六:SecureElement安全硬件】
android
一只特立独行的Yang2 小时前
Android Graphics - openGL and Vulkan小结
android
2501_915921432 小时前
在 Linux 上通过命令行上架 iOS APP,Fastlane + AppUploader(开心上架)
android·linux·运维·ios·小程序·uni-app·iphone