ios - 如何关闭 UIPageViewController?

标签 ios uiviewcontroller uipageviewcontroller

我添加了一个 UIPageViewController在我的新游戏中获取说明,我想关闭 UIPageViewController在用户按下最后一个 UIViewController 上的“GOT IT”按钮后连接到 UIPageViewController

到目前为止我已经试过了:

[self.pageVC dismissViewControllerAnimated:YES completion:nil];

而且它不会删除 UIPageViewController , 为什么呢?

我怎样才能消除它?

为了显示/呈现 UIPageViewController我这样做:

[self addChildViewController:self.pageVC];
[self.view addSubview:self.pageVC.view];
[self.pageVC didMoveToParentViewController:self];

最佳答案

请尝试与您描述的相反的调用:

[self.pageVC.view removeFromSuperview];
[self.pageVC removeFromParentViewController];

关于ios - 如何关闭 UIPageViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24849345/

相关文章:

ios - 如何强制 MapView 覆盖 ViewController 上的所有空间?

ios - 何时以及如何使子 UIViewController 无效

ios - ARM7和ARM7s有什么区别

android - 将 iframe 添加到 Appcelerator 应用程序

ios - 如何在创建的 UIViewController 中执行另一个 UIViewController 的函数

ios - UIPageViewController (ScrollStyle) 不调用 dataSource 方法

ios - 使用 swipegester 自定义页面浏览指示器和 uipageviewcontroller

ios - 需要像在 AppStore 中一样进行网页浏览

ios - ios5中的自动旋转——失败的最常见原因?

ios - 从层次结构中删除以前的 View Controller