繁体   English   中英

通过strings.xml文件添加符号

[英]Adding symbols through strings.xml file

我从这样的strings.xml文件显示Activity's Title

setTitle(R.string.add_contact_title);

我在strings.xml有以下string

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

但我想,显示一个类似标题Añadir Contacto而不是Anadir Contacto

有什么方法可以在strings.xml文件中执行此操作,而不是从其他来源复制并粘贴字符?

您也可以使用\\ u转义序列使用unicode,如下所示:

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

请参阅此处以获取常见的unicode拉丁字符列表: http : //unicode-table.com/en/#latin-extended-b

您可以使用&#241;

您可以在此页面中找到所有HTML特殊字符

Android和HTML中的特殊字符

只需替换您要放置该字符的代码即可。 :-)

是的,你可以这么做。 您必须以&amp开头特殊字符,也就是说,对于您的情况而言,它将类似于&#241;

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

只需检查将ASCII转换为Unicode的链接ASCII转换为UnicodeUnicode参考

暂无
暂无

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

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