简体   繁体   English

通过strings.xml文件添加符号

[英]Adding symbols through strings.xml file

I am displaying Activity's Title from strings.xml file like this 我从这样的strings.xml文件显示Activity's Title

setTitle(R.string.add_contact_title);

I have following string in strings.xml 我在strings.xml有以下string

<string name="add_contact_title">Anadir Contacto</string>

but i want to display title like Añadir Contacto instead of Anadir Contacto . 但我想,显示一个类似标题Añadir Contacto而不是Anadir Contacto

is there any way to do this within the strings.xml file rather than copying and pasting the characters from another source? 有什么方法可以在strings.xml文件中执行此操作,而不是从其他来源复制并粘贴字符?

You can also use unicode using the \\u\u003c/strong> escape sequence like this: 您也可以使用\\ u转义序列使用unicode,如下所示:

<string name="add_contact_title">A\u00F1adir Contacto</string>

See here for a list of common unicode latin characters: http://unicode-table.com/en/#latin-extended-b 请参阅此处以获取常见的unicode拉丁字符列表: http : //unicode-table.com/en/#latin-extended-b

You can use &#241; 您可以使用&#241;

You can find all the HTML Special Characters in this page 您可以在此页面中找到所有HTML特殊字符

Special Characters in Android & HTML Android和HTML中的特殊字符

just replace the code where you want to put that character. 只需替换您要放置该字符的代码即可。 :-) :-)

Yes you can do that. 是的,你可以这么做。 You have to start the special character with &amp ie for your case it will be like &#241; 您必须以&amp开头特殊字符,也就是说,对于您的情况而言,它将类似于&#241;

<string name="add_contact_title">A ñ adir Contacto</string> <string name="add_contact_title">A adir Contacto</string>

Just check the link which will convert ASCII into Unicode ASCII to Unicode and Unicode Reference 只需检查将ASCII转换为Unicode的链接ASCII转换为UnicodeUnicode参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM