当前位置: 代码迷 >> Android >> R类不自动改变,以及R类不见了的有关问题
  详细解决方案

R类不自动改变,以及R类不见了的有关问题

热度:34   发布时间:2016-05-01 10:05:57.0
R类不自动改变,以及R类不见了的问题
我的android工程里面,在/res/layout/sub.xml里面写了一个Button和Text

    <EditText
        android:id="@+subId/otherActivityDate"
        android:layout_width = "fill_parent"
        android:layout_height = "wrap_content"
        />
    <Button 
        android:id = "@+subId/return_parentBtn"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="return your other View"
        />


我觉得,这个<Button>里面的id取名return_parentBtn,我个人感觉不形象,于是,我将Button的id改名叫
return_otherBtn
接着,我点击Ctrl+S保存文件,

之后,发现,R类没有变化 !!!!!!!

百度了很久,之后,根据百度的建议,我选择了Eclipse中“clean”,选中“clean projects selected below”!

之后,R类不见了!!!
之后,重启了n变Eclipse,照旧
----------------以上,是我这 2 个问题的描述 ------------------
以下是我修改后的xml,请看

    <EditText
        android:id="@+subId/otherActivityDate"
        android:layout_width = "fill_parent"
        android:layout_height = "fill_parent"
        />
    <Button 
        android:id = "@+subId/return_other_Btn"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="return your other View"
        />


请教:
1、为什么我改了名字后R类不变 ? 【我已经 Build Automatically了】
2、为什么我clean了后R类被删掉,并且没有了 ?
3、如果修改 【这是重点】

------解决方案--------------------
我自己的使用经验:
  相关解决方案