How to create UIPageviewcontroller within container using iOS Objective C?

試著忘記壹切 提交于 2019-12-11 14:41:09

问题


I have created UIPageviewcontroller Inside the container with two sub view controllers for page navigation. Now the problem Is I have set the constraints for container on mainviewcontroller like below

Issue : Need to control the container. its showing top side and hiding top custombar and landscape also Its not sowing. I have create container on base view. the base view have good constraints.


回答1:


For above issue We need to set like below

// Add the page view controller to this root view controller.
[self addChildViewController:self.pageViewController];
self.pageViewController.view.frame = self.containerView.frame;
[self.containerView addSubview:self.pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];


来源:https://stackoverflow.com/questions/34260515/how-to-create-uipageviewcontroller-within-container-using-ios-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!