是否可以在UIPopoverviecontroller中显示splitviewcontroller?

问题描述 投票:0回答:0

在我的一个UI需求中,我想在popover中显示UISplitviewcontroller.我的代码如下。

UIViewController * vc1 = [[UIViewController alloc] init];
UIViewController * vc2 = [[UIViewController alloc] init];
UISplitViewController* splitVC = [[UISplitViewController alloc] init];

splitVC.viewControllers = [NSArray arrayWithObjects:vc1, vc2, nil];   
CGFloat height = 600;
CGFloat width = 200;

_popoverController = [[UIPopoverController alloc] initWithContentViewController:splitVC];
_popoverController.popoverBackgroundViewClass = [CustomPopupoverBackground class];
[_popoverController setPopoverContentSize:CGSizeMake(width, height)];
[_popoverController presentPopoverFromRect:button.frame  inView:button.superview permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

这产生了以下错误*。

'应用程序试图用全屏或自定义以外的模态展示风格来展示一个分离式视图控制器'。

*

是否可以在popover中显示splitview,如果不可以,如何在popover中同时显示两个主细节?

感谢Ritika

ios uisplitviewcontroller uipopovercontroller master-detail
© www.soinside.com 2019 - 2024. All rights reserved.