我想顯示html "<html><body><font color=\"black\">In the name of <font color=\"blue\"><b> God</b></font>the compassionate, the merciful</font></body><html>"
int TextView。所以我用Html.fromHtml()
。但輸出與瀏覽器相比是不同的。android Html.fromHtml()在嵌套文本樣式上無法正常工作
區別在於單詞「God」不會以藍色int TextView出現。
代碼:
textView.setText("<html><body><font color=\"black\">In the name of <font color=\"blue\"><b> God</b></font>the compassionate, the merciful</font></body><html>");
請分享您的代碼! –
此外,如果您有任何屏幕截圖與瀏覽器的區別,請分享 – jnthnjns
也可能的移動和瀏覽器輸出截圖。 –