如何把空格字符成XML字符串的名字吗?空格、字符串、字符、名字

2023-09-04 08:55:57 作者:aholic(沉迷者)

我已经定义了的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