<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
    <EditText android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:id="@+id/mobile"
    />
    <Button android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:text="@string/button"
            android:id="@+id/button"
            />
</LinearLayout>
下划线部分错误   
error: Error: No resource found that matches the given name (at 'text' with value '@string/
 button').我是新手,刚开始学习, 不知道这是什么错误, 在线等,,,,

解决方案 »

  1.   

    android:text="@string/button"
    这句是引用res/values/string.xml中的button属性,自己添加上去就行了
      

  2.   

    在/res/values/strings.xml 中定义button
      

  3.   

    我是新手, 自学的,在/res/values/strings.xml 中定义button
    怎么定义, 给一个例子。谢谢了 。
      

  4.   

    <string name="button">button</string>
      

  5.   

    在res/string目录下创建一个strings.xml(可以用eclipse的new file功能来创建一个android xml文件)
    然后在里面写上5L的那句。
      

  6.   

    修改res/string目录下的strings.xml文件,增加一行:
    <string name="button">按钮名称</string>
      

  7.   

    修改res/string目录下的strings.xml文件,增加一行:
    <string name="button">按钮名称</string>