【问题标题】:Bypass UIScrollViewDelegate when scroll in UICollectionView在 UICollectionView 中滚动时绕过 UIScrollViewDelegate
【发布时间】:2018-11-22 09:52:41
【问题描述】:

我有一个 UICollectionView,它是 UIScrollView 的子视图。当 UICollectionView 内部有滚动时,是否可以绕过 UIScrollViewDelegate?

【问题讨论】:

    标签: ios uiscrollview uicollectionview


    【解决方案1】:

    您可以像下面这样签入您的 UIScrollViewDelegate 方法并绕过您在该方法中的实现。

    例子:

    func scrollViewDidScroll(_ scrollView: UIScrollView) {
    
            guard scrollView != yourCollectionView else{
    
                return
            }
    
            //Your implementations goes here
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-27
      • 1970-01-01
      • 2016-06-04
      • 2013-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多