HtmlFromHtml覆盖View上的文本颜色选择器

时间:2016-09-21 14:32:05

标签: android android-layout android-styles

我有一个带有xml样式的自定义颜色选择器设置的textview。

选择器:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/light" android:state_enabled="false"/>
    <item android:color="@color/dark" />
</selector>

我将文字设置为:

mView.setText(Html.fromHtml("Some incoming html text"));

这会覆盖视图上的当前文本选择器。

我也试过像这样重置选择器:

mView.setTextColor(ContextCompat.getColor(getContext(),R.color.sel);

我需要保持风格相同,任何想法?

0 个答案:

没有答案