【发布时间】:2015-12-04 21:39:37
【问题描述】:
我正在尝试以不透明度为 75% 的白色在 Textview 中编写文本,但我得到的文本是黑色的,尽管在 HTML 页面中测试它时它工作正常。为什么会这样?
代码:
String text = "<span style=\"color: #ffffff; opacity: 0.75;\">Text </span>";
myTextView.setText(Html.fromHtml(text));
【问题讨论】:
-
见
ForegroundColorSpandocs
标签: android html colors textview opacity