美文网首页
Android 默认项目中 Button 大写修改

Android 默认项目中 Button 大写修改

作者: _一叶孤帆 | 来源:发表于2020-10-19 17:40 被阅读0次

默认创建的Android项目,当你在 Button 上显示内容时,会默认显示为大写。

如下:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <Button
        android:id="@+id/button1"
        android:text="Button1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>
image.png

解决方案

找到 styles.xml 文件

image.png

按照下图添加:


image.png
<item name="textAllCaps">false</item>

验证

image.png

相关文章

网友评论

      本文标题:Android 默认项目中 Button 大写修改

      本文链接:https://www.haomeiwen.com/subject/ryclmktx.html