Skip to content

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

@cuzv

Description

@cuzv

不确定这个是不是我的姿势不正确,文章中提到在 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 没有区别,效果还是一样。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions