Search code examples
iosswiftuipageviewcontroller

Scrollable Menu Section with Buttons


I'm attempting to create a menu that you can scroll left and right on that only takes up a section of the page. Here is a simple sample of that:

Sample

The everything below the top bar and the top of the pagecontrol move left and right. I attempted to use a pageviewcontroller but all of the tutorials I've found use it with static objects. If any buttons are used, they are used outside the pageviewcontroller.

My question is if there is something like the pageviewcontroller that I can place buttons on which scrolls left and right in the same manner?


Solution

  • I would follow one of two possible ways:

    1) Creation of pageViewController with designed individual pages of pageViewController, that have properly designed layout, i.e. centering and optimizing sizes of buttons etc.

    2) Creating of UICollectionView, that uses horizontal pagination. Some solutions are described here:

    UICollectionView with Paging Enable