Connect two UIScrollView's together

后端 未结 2 1849
小鲜肉
小鲜肉 2021-01-06 02:57

Here\'s a tricky iPhone problem I\'ve been working on. I have three UIScrollViews on a page, one that only scrolls horizontally, one that only scrolls vertically, and one th

2条回答
  •  孤街浪徒
    2021-01-06 03:04

    I think the simplest way would be to add a delegate to your scrollviews which implement the following method:

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView
    

    Then you can check the contentOffset to check by how much the scrollview did actually scroll, and update the main scrollview accordingly.

提交回复
热议问题