如何使用c#获取活动的字符串数组。我曾经这样用java做过:
getResources().getStringArray(R.array.activities)
THKS
答案 0 :(得分:2)
根据这个example,它应该是:
string[] countries = Resources.GetStringArray (Resource.array.countries_array);
已定义
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="countries_array">
<item>Bahrain</item>
<item>Bangladesh</item>
<item>Barbados</item>
<item>Belarus</item>
<item>Belgium</item>
<item>Belize</item>
<item>Benin</item>
</string-array>
</resources>