引用一个XML字符串中的XML阵列(安卓) [英] Referencing an XML string in an XML Array (Android)
本文介绍了引用一个XML字符串中的XML阵列(安卓)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在arrays.xml
in arrays.xml
<string-array name="my_items">
<item>My item 1</item>
<item>My item 2</item>
<item>My item 3</item>
</string-array>
在的strings.xml
in strings.xml
<resources>
<string name="item1">My item 1</string>
<string name="item2">My item 2</string>
<string name="item3">My item 3</string>
</resources>
我想引用字符串从strings.xml中数组我的第1项研究。我该怎么办呢?
I would like to reference the string in the array "My item 1" from strings.xml. How do I do that?
推荐答案
哦,是啊,这就是我的意思。这是我做的。
oh yeah, that is what I meant. This is how I did it.
<string-array name="my_items">
<item>@string/item1</item>
<item>@string/item2</item>
<item>@string/item3</item>
</string-array>
这在Android 1.6的解决正确
It resolved correctly in Android 1.6
这篇关于引用一个XML字符串中的XML阵列(安卓)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文