0
我可以看到有多種方式可以使用Html字符串。在Android strings.xml中使用HTML字符串的最佳方式是什麼?我在下面提到了兩種方法:哪一種是可取的,爲什麼?在Android strings.xml中使用HTML字符串的最佳方式
- 使用CDATA
<string name="test"><![CDATA[Test Message.<br/><br/>Please contact <a href="mailto:[email protected]" target="_top">[email protected]</a> for more details.</string>
- 使用Unicode
<string name="test">Test Message.<br/><br/>Please contact <a href="mailto:[email protected]" target="_top">[email protected]</a> for more details.</string>
我不找任何具體情況。上面的字符串只是一個例子。我需要了解每種方法的優缺點。在少數設備上,'<'可能會被一些垃圾替代,所以最好使用unicode。這個問題是否也可以通過使用CDATA標籤解決? –