iPad presentViewController 始终是全屏(需要表单表)iOS6



当用户点击通用应用程序iPad侧导航栏中的"设置"按钮时,我需要将视图控制器显示为formSheet。该视图称为"SettingsViewController",它是我的iPad情节提要中的视图控制器,ID为"settings"。

我没有使用 segues,因为在我的 iPad 版本的应用程序中,左侧导航栏中有多个按钮,所以我必须按程序添加按钮。(无法将续集连接到情节提要中不存在的 UIBarButtonItem。

我想要的功能在那里,演示文稿没有。当我在iPad上展示我的SettingsViewController时,它显示为全屏视图。我需要它是一个表单表。

我把它包裹在一个NavigationController,我需要并且工作正常,只需要它以正确的方式呈现自己。

下面是显示视图的代码:

-(void)showSettings:(id)sender {
    SettingsViewController *svc = [self.storyboard instantiateViewControllerWithIdentifier:@"settings"];
    svc.delegate = self;
    svc.modalPresentationStyle = UIModalPresentationFormSheet;
    UINavigationController *navcont = [[UINavigationController alloc] initWithRootViewController:svc];
    [self presentViewController:navcont animated:YES completion:NULL];
}

我已经尝试了我能想到的一切。任何帮助都深表感谢。

看起来您在SettingsViewController上设置了模态演示样式,但您应该在UINavigationController上设置它。

navcont.modalPresentationStyle = UIModalPresentationFormSheet;

最新更新