android报错: android.content.res.Resources$NotFoundException: Resource ID #0x7f080053 type #0x12 is no

在使用ListView的时候报错,然后想了想是不是ListView的问题,然后换成RecycleView,仍然报错

错误信息:
在这里插入图片描述
错误代码:

View view= LayoutInflater.from(parent.getContext()).inflate(R.id.book_chapter_item,parent,false);

原因及解决方法:
引用布局文件要用R.layout.book_chapter_item,不能使用id

View view= LayoutInflater.from(parent.getContext()).inflate(R.layout.book_chapter_item,parent,false);

猜你喜欢

转载自blog.csdn.net/rj2017211811/article/details/107297100