strings.xml使用方法

来源:互联网 发布:网络技术发展现状 编辑:程序博客网 时间:2024/06/07 06:42

方法一:

就是去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" />


0 0