Skip to content

Header刷新不回弹的问题#1329

Open
liuxiaoxinxin wants to merge 2 commits into
CoderMJLee:masterfrom
liuxiaoxinxin:master
Open

Header刷新不回弹的问题#1329
liuxiaoxinxin wants to merge 2 commits into
CoderMJLee:masterfrom
liuxiaoxinxin:master

Conversation

@liuxiaoxinxin

Copy link
Copy Markdown

在状态变化时,我不太明白当初为什么单独在UI切换至MJRefreshStateRefreshing状态时使用DispatchAsync,而在切换至MJRefreshStateIdle状态时不使用DispatchAsync。
我认为setState的调用者应该确保在主线程调用的,而不是在set方法内再用异步分发到主线程。

这里做DispatchAsync只会造成一个严重点问题:
如果beginRefreshing和endRefreshing在很近的时间段调用(这很常见,比如网络请求完成调用endRefreshing后,刚好用户又点击了TabBar按钮触发beginRefreshing),由于异步分发,可能会先执行恢复滚动区域再执行增加滚动区域, 造成头部累积增加contentInset.top,体验相当糟糕。

所以我去掉了MJRefreshDispatchAsyncOnMainQueue()部分,经过有限的测试没有发现其他问题。

@zmXie

zmXie commented Aug 16, 2019

Copy link
Copy Markdown

在ios12下,scrollview的contentInsetAdjustmentBehavior是默认状态,非调试状态,下拉刷新不会回弹,且contentInset.top会累积增加,但是连线调试又没有这个bug。。蛋都碎了

@NeverMaybe

Copy link
Copy Markdown

已经回退老版本

@jiexishede

Copy link
Copy Markdown

我也是遇到了偶尔下拉刷新不复位的情况。 这个问题哪个版本解决了, 希望在这里回复下。 更新到解决的版本试试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants