我想在我的strings.xml文件中创建以下字符串数组:
<string-array name="an_array_columns">
<item>% Select percentage1</item>
<item>% Select percentage2</item>
</string-array>
Run Code Online (Sandbox Code Playgroud)
这里的字符串是"%select percentage".现在,当我在strings.xml中写这个时,我收到以下错误:
Multiple annotations found at this line:
- error: Multiple substitutions specified in non-positional format; did you mean to
add the formatted="false" attribute?
- error: Found tag </item> where </string-array> is expected
Run Code Online (Sandbox Code Playgroud)
我知道我们可以改变&到&或'到\'的,但我该怎么为百分号吗?
ban*_*ing 72
%%似乎对我有用.例如:
<string name="num_percent">%1$d %%</string>
同
String oneHundredPercentString = getString(R.string.num_percent, 100); // This gives "100 %"
| 归档时间: |
|
| 查看次数: |
27353 次 |
| 最近记录: |