【问题标题】:UIRefreshControl weird jump when scrolling down with preferLargeTitles enabledUIRefreshControl 在启用 preferLargeTitles 的情况下向下滚动时出现奇怪的跳转
【发布时间】:2019-04-22 20:43:49
【问题描述】:

当我向下滚动我的collectionview 时,我的UIRefreshControl 无法正常工作。 refreshControl 即使轻轻滚动也会弹出并导致标题向下跳跃。

我试过了:

extendedLayoutIncludesOpaqueBars = true

这修复了一些问题,但在向下滚动以启用刷新控件时仍然会出现小跳(几乎不明显)。 如果我做prefersLargeTitles = false,它工作正常,没有跳跃。

【问题讨论】:

    标签: swift uirefreshcontrol preferslargetitles


    【解决方案1】:

    感谢UIRefreshControl 上糟糕的 Apple 文档,我花了几个小时试图修复它,但最终找到了解决方案。您必须在viewDidAppear 方法中添加您的refreshControl,我是在viewDidLoad 方法中添加它:

        override func viewDidAappear(_ animated: Bool) {
            super.viewDidAppear(animated)
            collectionView.refreshControl = refreshControl
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-02
      • 1970-01-01
      • 1970-01-01
      • 2012-06-23
      • 2012-05-07
      • 2019-12-15
      相关资源
      最近更新 更多