如何在TextView中显示双引号(“)符号? [英] How to display double quotes(") Symbol in a TextView?
本文介绍了如何在TextView中显示双引号(“)符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在xml文件的文本"视图中用双引号显示一些单词.但它不起作用.请帮助我.
I'm trying to display some words in double quotes, in Text view in in xml file. But its not working. Pls help me.
<TextView
style="@style/TextStyle"
android:text="message "quote string 1" and "quote string 2" end message"
android:id="@+id/lblAboutPara3"
android:autoLink="web"/>
任何人都知道解决方案.............
Any one knows solution for this.............
推荐答案
在strings.xml
中,您可以使用反斜杠简单地转义特殊字符(例如,双引号):
In the strings.xml
, you can simply escape special characters (eg double quotes) with a backslash :
"message \"quote string 1\" and \"quote string 2\" end message"
但是在视图xml中(例如layout.xml
),您必须使用HTML字符实体(例如"
):
But in views xml (eg layout.xml
), you have to use HTML character entities (like "
) :
"message "quote string 1" and "quote string 2" end message"
有关更多信息,请访问 http://developer.android.com/guide/topics/resources/string-resource.html
For more, visit http://developer.android.com/guide/topics/resources/string-resource.html
这篇关于如何在TextView中显示双引号(“)符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文