如何把空格字符成XML字符串的名字吗? [英] How to put space character into a string name in XML?

查看:106
本文介绍了如何把空格字符成XML字符串的名字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经定义了的strings.xml 文件中的一些字符串。现在我需要把一些数字之间有一些额外的空间字符串研究。当我输入额外的空格字符,这是不显示的应用程序,但。

i have defined some strings in the strings.xml file. Now I need to put some extra space between some numbers in the string. When I type extra space characters this is not showing on the application though.

<string name="spelatonertext3">-4, 5, -5, 6, -6,

如果我把额外的空间是这样的:

And if I put extra space like this:

<string name="spelatonertext3">-4,  5, -5,   6,  -6,

它只是看起来上的应用程序一样。我怎样才能使空格字符到XML字符串?

It just looks the same on the app. How can I make space characters into the XML string?

推荐答案

使用白色空间XML作为字符串使用&放大器;#160; 。 XML不会拿空白,因为它是。将它设置前,将修剪的空白。所以,使用&放大器;#160; ,而不是单个空格

to use white space in xml as string use &#160;. XML won't take white space as it is. it will trim the white space before setting it. So use &#160; instead of single white space

这篇关于如何把空格字符成XML字符串的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆