美文网首页
Android app多语言对应

Android app多语言对应

作者: 萝卜go | 来源:发表于2018-06-12 17:03 被阅读0次

    默认英文,目录: 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中的部分子项。

    相关文章

      网友评论

          本文标题:Android app多语言对应

          本文链接:https://www.haomeiwen.com/subject/vqdreftx.html