简体   繁体   中英

How to create multiple UIViews Inside the UIPageviewController using iOS storyboard?

I am trying to create different views Inside the pageviewcontroller but the pageviewcontroller want to show top of the half on viewcontroller . Please check below Image .

enter image description here

Create a scene for your CustomPageViewController (inherited from UIPageViewController) in the storyboard and add to viewDidLoad of this class:

self.dataSource = self;
self.delegate = self;

Now you can provide custom view controllers via UIPageViewControllerDataSource methods:

- (nullable UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController;
- (nullable UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController;

You can also create your custom view controller' scene in the storyboard and load it in the code:

CustomViewController *controller = [[UIStoryboard storyboardWithName:@"StoryboardName" bundle:nil] instantiateViewControllerWithIdentifier:@"CustomViewController"];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM