gpt4 book ai didi

安卓 : Color of fonts on preview window and real device are different

转载 作者:行者123 更新时间:2023-11-29 14:13:33 24 4
gpt4 key购买 nike

正如您在图像中看到的那样,模拟器上的字体颜色是全黑的,但在预览窗口中,顶部的 TextView 具有浅蓝色,底部文本具有白色字体。我已经在两个真实设备上测试了这个应用程序,但我面临着同样的黑色字体问题。我希望你们能帮助摆脱这个问题。这是代码。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.myfirstcard.MainActivity">
<ImageView
android:src="@drawable/ghat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Oldest City Of The World."
android:textSize="36sp"
android:textColor="#03a9f4"
android:layout_margin="20dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Incredible Varanasi!"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:fontFamily="sans-serif-light"
android:textSize="36sp"
android:textColor="#ffffff"
android:layout_margin="20dp"/>
</RelativeLayout>

enter image description here

最佳答案

您的 xml 布局没有任何问题,因为我已经复制粘贴并在实际设备上运行它。我认为问题出在您的 java 类中。尝试检查您的 java 类,因为我认为您正在以编程方式覆盖您的 TextView 颜色。

关于安卓 : Color of fonts on preview window and real device are different,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38112114/

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