<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="24sp"
android:text="@string/text1" />
X <Button android:id="@id/button1"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/red" />
X <Button android:id="@id/button2"
X android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_gravity="center"
X android:text="@string/green" />
</LinearLayout>
以上是我的xml文件的代码。前面打“X”的是报错的地方。都是同一个错误。报错是类似这样的:
No resource found that matches the given name (at 'text' with value '@string/green').小弟是新手,跪求指导
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TextView android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="24sp"
android:text="@string/text1" />
X <Button android:id="@id/button1"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/red" />
X <Button android:id="@id/button2"
X android:layout_width="80sp"
android:layout_height="wrap_content"
android:layout_gravity="center"
X android:text="@string/green" />
</LinearLayout>
以上是我的xml文件的代码。前面打“X”的是报错的地方。都是同一个错误。报错是类似这样的:
No resource found that matches the given name (at 'text' with value '@string/green').小弟是新手,跪求指导
解决方案 »
- File.exists()无法检测到SD卡上已经存在的文件
- 请问有没有可以代替租服务器的办法
- LocationManager的getLastKnownLocation("gps")异常问题
- 哪位大侠知道android的framewrok/文件夹下的代码最终运行在哪?
- 有没有支持Android的理财软件
- 【广州•6月27日】 第一届Android开发者大会诚邀您的参与
- android 中 怎么用java 调用 so 库
- android 报错求解
- 求助,menu item过多情况下的显示问题
- android EditText 模拟器中无法输入字符
- 怎么修改2.3android系统中的通讯录Contacts
- android udp真是垃圾啊还是我写得垃圾。
<string name="green"> </string>
<string name="red"> </string>
<string name="red"> </string>
<string name="text1"> </string>
<string name="button1"> </string>
<string name="button2"> </string>
这两句<Button android:id="@id/button2"
<Button android:id="@id/button1"
还是报错:No resource found that matches the given name (at 'id' with value '@id/button1').
<resources>
<item type="id" name="button1"></item>
<item type="id" name="button2"></item>
</resources>