Android Studio文本所有大写不起作用

Android Studio文本所有大写不起作用,android,Android,正如您所看到的,“我的文字所有大写”属性未勾选一样,“我的设计工具”窗口以小写形式显示文字,但我的仿真器没有。我的手机也发生了同样的事情。请帮忙 以下是我的xml代码: activity_main.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/and

正如您所看到的,“我的文字所有大写”属性未勾选一样,“我的设计工具”窗口以小写形式显示文字,但我的仿真器没有。我的手机也发生了同样的事情。请帮忙

以下是我的xml代码: activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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="com.example.ishansrivastava.a01_06_05_displaying_images_again.MainActivity">

    <include
        layout="@layout/reusable_layout"
        android:layout_width="0dp"
        android:layout_height="83dp"
        tools:layout_constraintTop_creator="1"
        tools:layout_constraintRight_creator="1"
        android:layout_marginStart="3dp"
        android:layout_marginEnd="3dp"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginTop="3dp"
        tools:layout_constraintLeft_creator="1"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginLeft="3dp"
        android:layout_marginRight="3dp"
        app:layout_constraintHorizontal_bias="0.0"
        android:id="@+id/include" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="366dp"
        android:layout_height="304dp"
        app:srcCompat="@drawable/levels"
        tools:layout_constraintRight_creator="1"
        tools:layout_constraintBottom_creator="1"
        android:layout_marginStart="8dp"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_marginEnd="8dp"
        app:layout_constraintRight_toRightOf="parent"
        tools:layout_constraintLeft_creator="1"
        android:layout_marginBottom="16dp"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        app:layout_constraintHorizontal_bias="0.0" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="158dp"
        android:layout_height="0dp"
        android:layout_marginStart="16dp"
        android:gravity="fill_vertical|center_horizontal"
        android:text="Plain"
        android:textSize="18sp"
        tools:layout_constraintBottom_creator="1"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintTop_creator="1"
        app:layout_constraintBottom_toBottomOf="@+id/webView"
        android:layout_marginTop="15dp"
        app:layout_constraintTop_toBottomOf="@+id/include"
        android:layout_marginBottom="14dp"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_marginLeft="16dp" />

    <Button
        android:id="@+id/button2"
        android:layout_width="155dp"
        android:layout_height="53dp"
        android:layout_marginEnd="13dp"
        android:layout_marginRight="13dp"
        android:layout_marginTop="2dp"
        android:onClick="onButton2Click"
        android:text="Search the Web"
        app:layout_constraintRight_toRightOf="@+id/include"
        app:layout_constraintTop_toBottomOf="@+id/include"
        tools:layout_constraintRight_creator="1"
        tools:layout_constraintTop_creator="1"
        tools:textAllCaps="false" />

    <WebView
        android:id="@+id/webView"
        android:layout_width="0dp"
        android:layout_height="35dp"
        tools:layout_constraintLeft_creator="1"
        tools:layout_constraintRight_creator="1"
        tools:layout_constraintTop_creator="1"
        app:layout_constraintRight_toRightOf="@+id/button2"
        android:layout_marginTop="9dp"
        app:layout_constraintTop_toBottomOf="@+id/button2"
        app:layout_constraintLeft_toLeftOf="@+id/button2" />

</android.support.constraint.ConstraintLayout>

可重用的_layout.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="368dp"
    android:layout_height="495dp"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    tools:layout_editor_absoluteX="8dp"
    tools:layout_editor_absoluteY="8dp"
    tools:showIn="@layout/content_main">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="horizontal">

        <CheckBox
            android:id="@+id/checkBox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Pepperoni" />

        <CheckBox
            android:id="@+id/checkBox2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Extra Cheese" />
    </LinearLayout>

    <Button
        android:id="@+id/button"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:onClick="onButtonClick"
        android:text="Show Image"
        tools:textAllCaps="false" />

</LinearLayout>

在你的按钮上试试这个

android:textAllCaps="false"
如果它不起作用,那就试试这个,我的朋友

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:buttonStyle">@style/Button</item>
</style>

<style name="Button" parent="Widget.AppCompat.Button">
    <item name="android:textAllCaps">false</item>
</style>

@样式/按钮
假的
关于你的另一个评论,请检查这个

    <style name="AppTheme" parent="AppBaseTheme">
    <item name="android:buttonStyle">@style/Button</item>
</style>

<style name="Button" parent="Widget.AppCompat.Button">
    <item name="android:textAllCaps">false</item>
</style>

@样式/按钮
假的

应用于所有按钮的应用程序主题可能会将按钮文本转换为大写。检查主题/样式文件以设置属性android:textAllCaps。

标准按钮样式…请分享您的xml代码编辑问题并添加代码@SunishaSindhutools:textAllCaps=“false”将此更改为android:textAllCaps=“false”谢谢@SunishaSindhu它正在工作。在使用设计工具时,如何将其设置为默认值?谢谢,它起作用了!我把工具换成了android。我想知道为什么它在使用设计工具时默认不这样做是的,当然,但我必须等待一段时间,这个网站才能让我接受答案。对不起,我是初学者,我不知道在哪里可以找到主题/样式文件好的。只需转到app\src\main\res\values\styles.xml。在那里你可以设置谢谢你,我做了那些改变,把android改回了工具,现在它可以工作了。我会在每个项目都这样做吗?根据你的要求。
    <style name="AppTheme" parent="AppBaseTheme">
    <item name="android:buttonStyle">@style/Button</item>
</style>

<style name="Button" parent="Widget.AppCompat.Button">
    <item name="android:textAllCaps">false</item>
</style>