Layout state should be one of 100 but it is 10
来源:互联网 发布:电影魔方软件下载 编辑:程序博客网 时间:2024/06/06 13:17
最近使用RecyclerView时遇到如下错误:
E/AndroidRuntime: FATAL EXCEPTION: mainjava.lang.IllegalStateException: Layout state should be one of 100 but it is 10at android.support.v7.widget.RecyclerView$State.assertLayoutStep(RecyclerView.java:10053)at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3045)at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2917)at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3283)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:596)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.widget.FrameLayout.onLayout(FrameLayout.java:448)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:437)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.widget.FrameLayout.onLayout(FrameLayout.java:448)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1655)at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1513)at android.widget.LinearLayout.onLayout(LinearLayout.java:1426)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.widget.FrameLayout.onLayout(FrameLayout.java:448)at android.view.View.layout(View.java:13916)at android.view.ViewGroup.layout(ViewGroup.java:4424)at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2029)at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1850)at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1143)at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4667)at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)at android.view.Choreographer.doCallbacks(Choreographer.java:555)at android.view.Choreographer.doFrame(Choreographer.java:525)at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)at android.os.Handler.handleCallback(Handler.java:615)at android.os.Handler.dispatchMessage(Handler.java:92)
最后通过比较发现是创建视图时报的错:
view = View.inflate(mContext, R.layout.item_search_main_comm, null);
改为下面这句就好了:
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_search_main_comm, parent, false);
坑爹啊,网上找了半个小时都没有找到!
阅读全文
0 0
- Layout state should be one of 100 but it is 10
- JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
- “JTAG Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.” 解决方案
- Stack is one important segment of the process’s memory layout. It is a dynamic memory buffer portion
- Keil5 IROM1 IRAM1 设置及错误JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
- "cabal: ar is required but it could not be found"
- Friend function should be a public function, if it is in a class.
- What is an abstract class, and when should it be used?
- “App” is damaged and can’t be opened. You should move it to the Trash.
- TypeError: POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type s
- Bean named 'BService' is expected to be of type 'path1' but was actually of type 'path2'
- is expected to be of type but was actually of type 'com.sun.proxy.$Proxy70'
- Depends: mysql-server-5.5 but it is not going to be installed
- Depends:libreoffice-base but it is not going to be installed
- (Pod造成的)One of the two will be used. Which one is undefined.
- One of the two will be used. Which one is undefined.
- The State of Visual Analytics Views on what visual analytics is and where it is going
- The type of the expression must be an array type but it resolved to Point
- ajax请求之后,后台代码没有处理,浏览器控制台都没有报错,状态码变成302的原因
- Spring 接口类InitializingBean实现初始化
- Mybatis 自动生成代码工具(maven方式)
- javascript迭代方法、归并方法
- ShaderWeaver卡片制作-第一节
- Layout state should be one of 100 but it is 10
- this license **** has been cancelled
- Centos7.x Gitlab10安装及汉化
- 设计模式之观察者模式
- @ eclipse 一般设置
- android过渡动画之makeSceneTransitionAnimation
- 简单加密壳项目笔记
- 初级Java学习笔记总结
- 剑指offer — 数据流中第一个不重复的数字