首页 > 其他 > 详细

在布局文件/layout中加的id,在R文件中却没有显示?

时间:2015-05-24 15:25:22      阅读:574      评论:0      收藏:0      [点我收藏+]

新建android工程,在/layout/activity_main.xml文件中,新建了一个Button,

<Button
        android:id="@+id/person"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/person" />

但是,该ID资源person却没有在MainActivity中调用出来,

person=(Button)this.findViewById(R.id.person);

查看/R.java文件也没有找到对应的ID资源;

此时,解决办法是:

Project->Build All后 自动生成。

在布局文件/layout中加的id,在R文件中却没有显示?

原文:http://www.cnblogs.com/lonsine/p/4525841.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!