gpt4 book ai didi

android - textAppearance 在 TextView 中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 10:46:20 25 4
gpt4 key购买 nike

我在 TextView 中显示链接文本。一开始,我的代码是这样的:

<TextView
style="@style/informed_consent_check_TextView"
android:id="@+id/accept_content_1"
android:text="@string/informed_consent_accept"
/>


<style name="informed_consent_check_TextView" >
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">13dp</item>
<item name="android:textColor">#fff</item>
<item name="android:textColorLink">#fff000</item>
</style>

它工作正常。链接文本显示如下:

enter image description here

这就是我想要的。

但是,在我将有关文本的属性移动到样式中之后。它工作不正常。

<style name="informed_consent_content_textAppearance">
<item name="android:textSize">13dp</item>
<item name="android:textColor">#fff</item>
<item name="android:textColorLink">#fff000</item>
</style>

<style name="informed_consent_check_TextView" >
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">@style/informed_consent_content_textAppearance</item>
</style>

链接文本显示错误的颜色: enter image description here

然后,我将 textAppearance 属性移动到 TextView 中。但还是错了。

<TextView
style="@style/informed_consent_check_TextView"
android:id="@+id/accept_content_1"
android:text="@string/informed_consent_accept"
android:textAppearance="@style/@style/informed_consent_content_textAppearance"/>

我的设备是 4.1.2 。

谁能帮帮我。非常感谢。

最佳答案

修改textview属性

android:textAppearance = "@style/informed_consent_content_textAppearance"

关于android - textAppearance 在 TextView 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22978395/

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