Search code examples
iosuiscrollviewuipagecontrol

Can I create a UIPageControl / UIScrollview where the pages are larger than the screen size?


I am writing an App where we want to have several pages in a UIPageControl/UIScrollView. The problem is I need some space between each page - in other words, scrolling from page 1 to page 2 there is a visible gap between the pages.

I've tried doing this by setting the page's frames to be larger than the UIScrollView, but I can't seem to get this working. Does anybody know if it can be done?


Solution

  • The page size is always the same as the width of the scroll view. To make the pages larger than the visible area, you should make the scroll view itself a little larger, too. For example, if the width of the screen is 320 points, make the scroll view 340 points wide (10 points overhang on each side).