Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用iOS Objective C在容器中创建UIPageviewcontroller?_Ios_Objective C_Storyboard - Fatal编程技术网

如何使用iOS Objective C在容器中创建UIPageviewcontroller?

如何使用iOS Objective C在容器中创建UIPageviewcontroller?,ios,objective-c,storyboard,Ios,Objective C,Storyboard,我在容器中创建了UIPageviewcontroller,其中包含两个子视图控制器,用于页面导航。现在的问题是,我已经在mainviewcontroller上设置了容器的约束,如下所示 // Add the page view controller to this root view controller. [self addChildViewController:self.pageViewController]; self.pageViewController.view.frame = sel

我在容器中创建了UIPageviewcontroller,其中包含两个子视图控制器,用于页面导航。现在的问题是,我已经在mainviewcontroller上设置了容器的约束,如下所示

// 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];


问题:需要控制容器。它展示了顶部的一面,隐藏了顶部的定制栏和景观,也不是它的播种。我已经在基本视图上创建了容器。基本视图具有良好的约束。

对于上述问题,我们需要如下设置

// 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];

对于上述问题,我们需要如下设置

// 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];

更清楚地解释您的问题,当前显示方式,添加屏幕截图。请检查我是否已更新@Shubhank更清楚地解释您的问题,当前显示方式,添加屏幕截图。请检查我是否已更新@Shubhank