码迷,mamicode.com
首页 > 移动开发 > 详细

Android TextView文字空格

时间:2014-06-21 12:13:17      阅读:456      评论:0      收藏:0      [点我收藏+]

标签:android   code   http   tar   ext   com   

 表示全角空格,

    <string name="aaa">你好&#160;&#160;&#160;&#160;&#160;&#160;啊</string>

 

http://stackoverflow.com/questions/1587056/android-string-concatenate-how-to-keep-the-spaces-at-the-end-and-or-beginnin

1.Even if you use string formatting sometimes you still need whitespaces at the beginning or the end. On these cases neither escaping with \ nor xml:space attribute helpes. You must use xml encoding &#160;for whitespaces.

2.I found a solution on this issue report : http://code.google.com/p/android-apktool/issues/detail?id=14

This is the same idea that Duessi suggests. Insert \u0020 directly in the XML for a blank you would like to preserve.

Example :

<string name="your_id">Score :\u0020</string>

The replacement is done at build time, therefore it will not affect the performance of your game.

Android TextView文字空格,布布扣,bubuko.com

Android TextView文字空格

标签:android   code   http   tar   ext   com   

原文地址:http://www.cnblogs.com/tt_mc/p/3794806.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!