0

我有 UIPageViewController,其中包含几个 UIView,在每个视图中,都可以将 UIView 水平翻转到只包含一个视图的 NavigationController。我实现了这个功能,但似乎翻转只在第一次工作。

这是我首先翻转视图的方式:

UINavigationController *navController = [self.storyboard instantiateViewControllerWithIdentifier:@"BackViewController"];

//Pass some data to the back controller
[[[navController viewControllers] objectAtIndex:0] setDataObject:self.dataObject];

navController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentViewController:navController animated:YES completion:nil];

这就是我将其转回的方法:

PageRootController *pageRootController = [[self.storyboard instantiateViewControllerWithIdentifier:@"PageRootController"] initWithData:self.mydata];

pageRootController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentViewController:pageRootController animated:YES completion:nil];

就像我说的,这第一次很好用(我可以翻转它然后再翻转),一旦我再次点击它什么也不做。我是 iOS 编程新手,所以如果您需要更多信息,我可以粘贴它。

4

1 回答 1

0

The problem was that I had a new navigation controller inside each of my views, instead of pushing and popping views from the current one.

于 2013-02-21T20:40:00.763 回答