正如标题所说,我的问题是我不知道是否/如何在 string.xml 中的字符串资源中使用字符串资源。
<string name="projectname">Include Test</string>
<string name="about">@string/projectname is to test if you can use a String Resource in a String Resource</string>
我的问题是有没有人知道我是否会写
<string name="identifier">@string/other_identifier</string>
因为 Eclispe 说
error: Error: No resource found that matches the given name (at 'other_identifier' with value '@string/other_identifier eingeben...').
最佳答案
最好在运行时构建这些 String
。在 String.format
的帮助下将不同的 String
资源组合在一起。
更多详情:http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling
关于android - 我可以在 string.xml 中的字符串资源中使用字符串资源吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7245743/