UIScrollView: paging horizontally, scrolling vertically?

后端 未结 20 1254
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 09:09

How can I force a UIScrollView in which paging and scrolling are on to only move vertically or horizontally at a given moment?

My understanding is that

相关标签:
20条回答
  • 2020-11-27 09:51

    This works for me everytime...

    scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * NumberOfPages, 1);
    
    0 讨论(0)
  • 2020-11-27 09:54

    Guys it is as simple as making the subview height the same as the scroll view height and the content size height. Then the vertical scrolling is disabled.

    0 讨论(0)
提交回复
热议问题