0
我已經以編程方式添加了pageviewController
,如下所示。有用。但是,當我嘗試使用[self.pageViewController.view removeFromSuperview];
刪除它時,它不會將其刪除。以編程方式刪除PageViewController
添加pageViewController
self.pageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"];
self.pageViewController.dataSource = self;
self.pageViewController.delegate = self;
PageContentViewController *startingViewController = [self viewControllerAtIndex:0];
NSArray *viewControllers = @[startingViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];
刪除pageViewController
[self.pageViewController.view removeFromSuperview];
它有時不是。 – hotspring