Add UIScrollView with Paging to Existing UIViewController

后端 未结 3 1731
后悔当初
后悔当初 2021-01-13 08:27

I\'m wanting to add a UIScrollView with paging to go through different views from my existing view controller which is the root view of my app. I also have tab bar and navi

3条回答
  •  执念已碎
    2021-01-13 09:08

    I would perhaps try using UIPageViewController, rather than a regular paging scrollview.

    Apple's PhotoScroller sample code provides a very good example of how to use UIPageViewController.

    I also have some code on github that modifies PhotoScroller to load the UIPageViewController inside a UIViewController subclass. (In Apple's sample code, the UIPageViewController is the root view controller.)

    I have never used a UIPageViewController with different UIViewController subclasses in each page (the PhotoScroller sample code uses PhotoViewControllers in all pages), but I can't see why it couldn't be done with a few modifications to the code.

提交回复
热议问题