本文demo下载地址 DFLinkageViewDemo
实现效果:如下
层级结构:
核心内容;
1.让外层scrollView和内层scrollview同时滚动scroll
DFLinkageScrollView 内部实现
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
2.两个scrollview滚动的时候改变他们的contentoffset
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView == self {
contentViewDidScroller(view: scrollView)
} else if scrollView == p