0
votes

I have a UIScrollView that I am trying to page horizontally (the items on the scroll view are days). This works as intended. One unintentional issue is that the UIScrollView also pages vertically (I want it to scroll normally). Is there some way that I can disable vertical paging while enabling horizontal paging? There is another question similar to mine but it was 4 years ago, and the answers there were vague.

Thanks for helping.

1
Can you not have the outer scrollview with horizontal paging simply contain one vertical scrollview for each of the "pages"? Then the inner, vertical scrollviews will be set to only allow vertical scrolling (paging off) and the outer scrollview will only have horizontal, paged scrolling on.wottle

1 Answers

-1
votes

If you want your UIScrollView to not scroll vertically. You need to wrap your view height by 1. This way your height contentSize will be fixed by 1.

self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * numberPages, 1);