支持不同的语言,主要是通过定义不同的字符串文件:
MyProject/ res/ values/ strings.xml values-es/ strings.xml values-fr/ strings.xml英语:
/values/strings.xml
:
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="title">My Application</string> <string name="hello_world">Hello World!</string> </resources>汉语:/values-zh/string.xml
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="title">我的应用</string> <string name="hello_world">你好!</string> </resources>