-
Notifications
You must be signed in to change notification settings - Fork 157
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
adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! #12
Comments
你当前是使用1.2的版本不,之前是有错乱问题,在新的版本已经解决,方便看下你的代码不 |
设置manager
刷新adapter
------------------ 原始邮件 ------------------
发件人: "随风者";<[email protected]>;
发送时间: 2017年10月23日(星期一) 下午4:57
收件人: "1002326270xc/LayoutManager-FlowLayout"<[email protected]>;
抄送: "斌斌"<[email protected]>; "Author"<[email protected]>;
主题: Re: [1002326270xc/LayoutManager-FlowLayout] adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! (#12)
你当前是使用1.2的版本不,之前是有错乱问题,在新的版本已经解决,方便看下你的代码不
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
你这里没见你设置item的间距啊,能看下你的完整点的代码吗,你可以看下TextFlowActivity对数据的刷新是怎么使用的。 |
间距我直接用padding填充了!我没有编译您的库到我的工程,而是拷贝您的文件到我的项目中去的!不知道您GitHub上是不是1.2版本的!
…------------------ 原始邮件 ------------------
发件人: "随风者";<[email protected]>;
发送时间: 2017年10月23日(星期一) 下午5:18
收件人: "1002326270xc/LayoutManager-FlowLayout"<[email protected]>;
抄送: "斌斌"<[email protected]>; "Author"<[email protected]>;
主题: Re: [1002326270xc/LayoutManager-FlowLayout] adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! (#12)
你这里没见你设置item的间距啊,能看下你的完整点的代码吗,你可以看下TextFlowActivity对数据的刷新是怎么使用的。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
flowmanager里面设置item的间距是通过recyclerView.addItemDecoration(new SpaceItemDecoration(dp2px(10)));来实现的,你这里的padding值是item的内间距吧。item是需要外间距的啊。github上面是最新的版本。 |
我看了一下您的刷新逻辑了,需要先清空数据,再重新填充数据。我试一试!
…------------------ 原始邮件 ------------------
发件人: "随风者";<[email protected]>;
发送时间: 2017年10月23日(星期一) 下午5:28
收件人: "1002326270xc/LayoutManager-FlowLayout"<[email protected]>;
抄送: "斌斌"<[email protected]>; "Author"<[email protected]>;
主题: Re: [1002326270xc/LayoutManager-FlowLayout] adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! (#12)
flowmanager里面设置item的间距是通过recyclerView.addItemDecoration(new SpaceItemDecoration(dp2px(10)));来实现的,你这里的padding值是item的内间距吧。item是需要外间距的啊。github上面是最新的版本。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
不是说先清空数据,这里只是演示清空的一种情况,你也可以直接进行添加的,不要被误导了。 |
我刚才试了一下:当把数据添加在最后一项的时候没有问题,但当把数据添加在数据中间,比如倒数第二项中就出现错乱!
------------------ 原始邮件 ------------------
发件人: "随风者";<[email protected]>;
发送时间: 2017年10月23日(星期一) 下午5:32
收件人: "1002326270xc/LayoutManager-FlowLayout"<[email protected]>;
抄送: "斌斌"<[email protected]>; "Author"<[email protected]>;
主题: Re: [1002326270xc/LayoutManager-FlowLayout] adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! (#12)
不是说先清空数据,这里只是演示清空的一种情况,你也可以直接进行添加的,不要被误导了。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
我刚才试了一下:当把数据添加在最后一项的时候没有问题,但当把数据添加在数据中间,比如倒数第二项中就出现错乱!
…------------------ 原始邮件 ------------------
发件人: "随风者";<[email protected]>;
发送时间: 2017年10月23日(星期一) 下午5:32
收件人: "1002326270xc/LayoutManager-FlowLayout"<[email protected]>;
抄送: "斌斌"<[email protected]>; "Author"<[email protected]>;
主题: Re: [1002326270xc/LayoutManager-FlowLayout] adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! (#12)
不是说先清空数据,这里只是演示清空的一种情况,你也可以直接进行添加的,不要被误导了。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
这个刚发现了,是初始化的时候没对整个页面进行remove初始化导致的,在onLayoutChildren初始化的时候调用下removeAllViews就可以了 |
好!我试一下!
…------------------ 原始邮件 ------------------
发件人: "随风者";<[email protected]>;
发送时间: 2017年10月23日(星期一) 下午5:52
收件人: "1002326270xc/LayoutManager-FlowLayout"<[email protected]>;
抄送: "斌斌"<[email protected]>; "Author"<[email protected]>;
主题: Re: [1002326270xc/LayoutManager-FlowLayout] adapter不能数据更新,调用notifyDataSetChanged()方法布局错乱! (#12)
这个刚发现了,是初始化的时候没对整个页面进行remove初始化导致的,在onLayoutChildren初始化的时候调用下removeAllViews就可以了
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
可以了!谢谢了! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: