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"/>
相关推荐
星霜笔记42 分钟前
GitMob — 手机端 GitHub 管理工具
android·kotlin·github·android jetpack
LiuYaoheng1 小时前
问题记录:Android Studio Low memory
android·ide·android studio
独隅2 小时前
Python 标准库 (Standard Library) 全面使用指南
android·开发语言·python
always_TT2 小时前
strlen、strcpy、strcat等常用字符串函数
android
qqty12172 小时前
MySQL Workbench菜单汉化为中文
android·数据库·mysql
2401_895521342 小时前
MySQL中between and的基本用法
android·数据库·mysql
云云鬼才3 小时前
CoCo编辑器、图形化编程怎么调用Scheme(跳转应用)
android
Jason__Young5 小时前
Android ViewModel为什么能够跨越Activity的生命周期?
android
TechMix5 小时前
【性能优化】RenderThread各工作阶段梳理
android·性能优化
草莓熊Lotso6 小时前
MySQL 内置函数指南:日期、字符串、数学函数实战
android·java·linux·运维·数据库·c++·mysql