+-

我试图在双引号中显示一些单词,在xml文件的Text视图中.但它不起作用.请帮助我.
<TextView
style="@style/TextStyle"
android:text="message "quote string 1" and "quote string 2" end message"
android:id="@+id/lblAboutPara3"
android:autoLink="web"/>
任何人都知道这个解决方案………….
最佳答案
在strings.xml中,您可以使用反斜杠转义特殊字符(例如双引号):
"message \"quote string 1\" and \"quote string 2\" end message"
但在视图xml(例如layout.xml)中,您必须使用HTML字符实体(如& quot;):
"message "quote string 1" and "quote string 2" end message"
有关更多信息,请访问http://developer.android.com/guide/topics/resources/string-resource.html
点击查看更多相关文章
转载注明原文:android – 如何在TextView中显示双引号(“)符号? - 乐贴网