如何在UIPageViewController中使用popover控制器?

时间:2012-12-12 11:22:58

标签: iphone objective-c ios ipad uipopovercontroller

我可以使用弹出框控制器返回页面视图控制器中的先前视图控制器。有没有办法这样做。

我正在尝试此代码。

-(void)goNext
{
Vcontr = [self.pageController.viewControllers objectAtIndex:0];

UIPopoverController *popoverController = [[UIPopoverController alloc] initWithContentViewController:pageController];

if(popoverController == nil){   //make sure popover isn't displayed more than once in the view
    popoverController = [[UIPopoverController alloc] initWithContentViewController:pageController];
}
[popoverController presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

popoverController.delegate = self;

 }

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

 UIPopoverController *popoverController ;///defin this in the .h

if(popoverController == nil){   //make sure popover isn't displayed more than once in the view
    popoverController = [[UIPopoverController alloc] initWithContentViewController:yourPageViewController]; 
}
[popoverController presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

popoverController.delegate = self;
}