默认英文,目录: values/strings.xml
<string name=“hello”>hello</string>
简体中文,目录: values-zh-rCN/strings.xml
<string name=“hello”>你好</string>
繁体中文,目录: values-zh-rTW/strings.xml
<string name=“hello”>你好</string>
注:
1.默认values/strings.xml中要包含其他语言目录下strings.xml中的所有子项。否则,在通过R.string.hello引用时,编译报错。
错误信息: hello cannot be resolved or is not a field.
2.其他目录中的strings.xml可以是values/strings.xml中的部分子项。
网友评论