0

我有一个应用程序,Split View controller. 我希望有弹出视图控制器来显示,当有一些特殊情况时(例如用户未注册。)。您可以在 iPad 的 Apple Messages 应用程序中看到这一点。没有第三方控制器有没有办法做到这一点?

编辑:我找到了解决方案:在情节提要中,用户可以在属性检查器的模拟指标部分设置表单。之后,通过模态转换可以打开弹出视图。

4

1 回答 1

2
If you are using Storyboard.... if using nib replace storyboard with your nib file

 // Create and configure a new detail view controller appropriate for the selection.
            UIViewController *objViewController = [UINavigationController new];

            objViewController = [self.storyboard                                   instantiateViewControllerWithIdentifier:@"WelcomePopupNavigationController"];                

            objViewController.modalPresentationStyle = UIModalPresentationFormSheet;
            objViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

            [self presentViewController:objViewController animated:YES completion:nil];

            //it's good to do this after presentModalViewController, but not neccessary if you using form sheet size of your view controller
            objViewController.view.superview.frame = CGRectMake(0, 0, 540, 620);
            objViewController.view.superview.center = self.view.center;

//vKj

于 2013-11-27T13:23:20.450 回答