gpt4 book ai didi

android - 更改 Android TextView 项目符号颜色

转载 作者:行者123 更新时间:2023-11-30 00:56:46 24 4
gpt4 key购买 nike

我在 XML 代码的 TextView 中使用项目符号,但我不知道为什么在某些设备中它的颜色是红色,而我的 TextView 颜色是白色。这可能是因为设备默认主题。我怎样才能让它变白。

Activity 主题:

 <style name="AppThemeOnBoarding" parent="Theme.AppCompat.Light.NoActionBar.FullScreen">
</style>

我的 XML 代码:

<TextView
android:gravity="center"
android:padding="20dp"
style="@style/TextView_shadow"
android:layout_centerInParent="true"
android:alpha="0.9"
android:textSize="13sp"
android:textColor="#ffffff"
android:text="i Verbindung am besten mit: \n✔ ABC\n✔ XYZ"
android:id="@+id/fitbit_connectiondesc"
android:layout_below="@id/fitbit_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

Result

最佳答案

check this image

 tv.setText(Html.fromHtml("i Verbindung am besten mit:" + "<font color=\"#ffffff\">" +"<br>✔ ABC <br>✔ XYZ"+ "</font><br><br>"));

//类似xml

<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

关于android - 更改 Android TextView 项目符号颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40013339/

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