gpt4 book ai didi

Android Studio 文本全部大写不起作用

转载 作者:行者123 更新时间:2023-11-30 00:29:14 25 4
gpt4 key购买 nike

ScreenShot

如您所见,我的文本全部大写属性未勾选,我的设计工具窗口以小写形式显示文本,但我的模拟器没有。我的手机也发生了同样的事情。请帮忙。

这是我的 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>

可重用布局.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>

最佳答案

tools:textAllCaps="false" change this in to 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>

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

关于Android Studio 文本全部大写不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44758397/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com