Couldn't resolve resource @id/pass问题的解决

来源:互联网 发布:石大access数据库应用 编辑:程序博客网 时间:2024/05/16 17:52

就比如

这个布局,布局如下


<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:paddingLeft="16dp"    android:paddingRight="16dp" >    <TextView        android:id="@+id/name"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_marginTop="20dp"        android:gravity="center"        android:text="@string/name"        android:textSize="22dp" />    <TextView        android:id="@+id/zhanghao"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_alignParentLeft="true"        android:layout_below="@id/name"        android:layout_marginTop="30dp"        android:text="@string/zhanghao"        android:textSize="15dp" />    <EditText        android:id="@+id/zhang"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_alignParentRight="true"        android:layout_below="@id/name"        android:layout_marginLeft="50dp"        android:layout_toLeftOf="@id/zhanghao" />    <TextView        android:id="@+id/password"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_alignParentLeft="true"        android:layout_below="@id/zhanghao"        android:layout_marginTop="25dp"        android:text="@string/password" />    <EditText        android:id="@+id/pass"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_below="@id/zhang"        android:layout_marginLeft="50dp"            />    <Button        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/zhu"         android:layout_below="@id/pass"        android:layout_alignParentRight="true"        android:id="@+id/button"        />        <!-- 为什么显示这个Couldn't resolve resource @id/pass -->           <Button         android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/deng"        android:layout_below="@id/pass"         android:layout_toLeftOf="@id/button"        />  </RelativeLayout>

但是在转换视图下总是显示

Couldn't resolve resource @id/pass

Couldn't resolve resource @id/button

这个问题一直困扰我,我不知道是什么原因导致的,

我仅仅知道解决方法是重启eclipse就可以了,然而clear是没用的

参考链接

http://stackoverflow.com/questions/8390733/relativelayout-couldnt-resolve-resource-android#


0 3
原创粉丝点击