Skip to content
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

下拉刷新导致的滑动问题 #9

Open
cuzv opened this issue Apr 27, 2021 · 4 comments
Open

下拉刷新导致的滑动问题 #9

cuzv opened this issue Apr 27, 2021 · 4 comments

Comments

@cuzv
Copy link

cuzv commented Apr 27, 2021

不确定这个是不是我的姿势不正确,文章中提到在 child vc 分别实现下拉刷新,我使用了最简单的系统控件 UIRefreshControl.

大致代码:

override func viewDidLoad() {
    // ...
    let refreshControl = UIRefreshControl()
    tableView.refreshControl = refreshControl
    refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
}

@objc private func refresh() {
    DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2)) {
        self.tableView.refreshControl?.endRefreshing()
    }
}

诡异效果:

图一:下拉滑动刷新过程中,左右拖拽 mainScrollView

1

图二:下拉滑动刷新未结束时,切换到其他 VC, 刷新完成后不会回弹

2

切换 keepChildScrollViewOffset 没有区别,效果还是一样。

@bawn
Copy link
Owner

bawn commented Apr 27, 2021

这个问题,我目前还没想好怎么处理比较好,确实是个 bug,推荐你用另外一个库,https://github.com/bawn/Aquaman

@cuzv
Copy link
Author

cuzv commented Apr 27, 2021

@bawn 二级 ScrollView 的实现效果更好,希望能解决吧。感谢分享🙏。

@bawn
Copy link
Owner

bawn commented May 10, 2021

@cuzv 已经已修复 => 9125415f9934900803ccd1bea5be86991dce68c0,暂时还没提交到 cocoapods 你可以通过分支形式引入

@cuzv
Copy link
Author

cuzv commented May 17, 2021

@bawn 滑动问题是好了,可能无意中引入了另外一个 bug: 切换 tab 后,顶部 header 会自己跳动。
UI is HARD :[
1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants