2014-03-31 97 views
1

如何存儲formattable字符串資源在​​,這樣它不會破壞我的R.java?目前我只是有以下但它不工作。存儲formattable字符串資源在string.xml

<string name="format_able">This is a formatable string resource with %s and %s as place holders</string> 

但是eclipse並沒有對它進行紅線標記。所以花了我幾小時才發現這是我的R沒有被生成的原因。那麼我如何逃脫%s

+0

http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling – njzk2

+0

你嘗試過了'項目> Clean' –

回答

0

嘗試更改HTML編碼的「%」字符。例如,要插入「......」你寫的代碼

"&#8230;" 

爲‘%’的代碼是

"&#37;" 

你可以看到它在這個頁面:http://www.ascii.cl/htmlcodes.htm

+0

可能你明確你的答案? – Blackbelt