I have three UIScrollViews, scrollView1
, scrollView2
, and scrollView3
. When scrollView1
is scrolled then scrollView2
should scroll horizontally with it, and when scrollView3
is scrolled then scrollView2
should scroll vertically with it. How can I do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The UIScrollViewDelegate protocol includes scrollViewDidScroll:.
You could set the contentOffset of your subserviant scrollviews using setContentOffset in scrollView2 and scrollView3 from scrollView1's delegate's scrollViewDidScroll: