New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IllegalArgumentException: Called attach on a child which is not detached: ViewHolder{2a49 #479
Comments
你的版本是?为什么要加removeAllFooterView? |
最新的 加removeAllFooterView是出现过没有更多数据和加载错误一起出现了 |
你有没有按demo里面的步奏来?demo是正常的。 |
想问下 showLoadMoreFailView 是不是只能再异步之中进行 |
在没有数据的时候不能调用setLoadMoreFailView |
setLoadMoreFailView的使用场景是在有数据的情况下,加载数据没有网络然后在setLoadMoreFailView添加一个错误提示,点击可以再次加载。 |
没有数据又加载错误的时候还是setEmptyView吗? |
恩 是的,setEmptyView是支持设置两个不同view的切换的。具体使用可见demo |
LoadMoreFailView的click事件 默认已经给你写好了。 |
如果开发者在调用 showLoadMoreFailed() 方法前传入自定义加载更多错误的View的话,就算没有 Context 也不会有问题的。 |
rxjava+retrofit2.0异步请求失败之后可以这么写吗? |
还是就是setErrorView(rv, remindAdapter); 但是这是emptyView |
showLoadMoreFailed() click事件我看了 但是感觉点击没效果 所以自己添加了view.click事件 |
这不是异步的问题,如果你第一次就没有数据adapter不会进入onCreateViewHolder,Context是在onCreateViewHolder里面赋值的,所以没有Context,然而showLoadMoreFailed需要加载布局所以要用到Context,Context没有就会报错。如果开发者在调用 showLoadMoreFailed() 方法前传入自定义加载更多错误的View的话,就算没有 Context 也不会有问题的。 |
正常的业务逻辑应该是,如果第一次没有数据就改变EmptyView,因为这时候是一整个屏幕的,而如果在有数据的情况下出现网络错误,那么就是调用showLoadMoreFailed显示一个错误的view。 |
嗯是的,谢谢大腿 |
没有其他问题了吧? |
showLoadMoreFailed 我想知道 这个点击的时候 是不是触发onscroll 会再次进入BaseQuickAdapter.RequestLoadMoreListener()。前几天,给搞混了empty和showLoadMoreFailed |
showLoadMoreFailed是打开了上拉的开关,上拉的触发判断就是如果item现在滑到了最后一条了,并且你的上拉开关没有关闭,就会触发RequestLoadMoreListener |
是不是点击了LoadMoreFailed事件 hide了之后 就会触发一次 我现在东西搞乱了~ |
恩,是的。 |
谢谢 我明白了 我之前是没有数据就showLoadMoreFailed,再这之前我是设置了setLoadMoreFailed,并且自己设置了点击事件 发现点击事件不好用~~ 谢谢大腿 ,没问题了 |
恩,好的,感谢你的使用。 |
当我界面上第一次获取数据时出错,我是这样写的
但我点击view 加载数据 再次获取没有数据并出错的时候,出现了java.lang.IllegalArgumentException: Called attach on a child which is not detached,求助
这是代码里的:我加了removeAllFooterView();
The text was updated successfully, but these errors were encountered: