strings.xml使用方法

方法一:

就是去values文件夹下的stings.xml中去添加:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">SMSTest</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>

</resources>

方法二:

点击某个控件,然后它在右下角的Properties属性中有Text属性,然后点击那三个小点点的按钮出现Resource Chooser框,然后可以New String:




方法三:

快捷键:ctrl+1:来将text中的文字设置为String串保存。



使用方法:

<Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/text_bt1" />

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念