我有一个带有 Split View controller 的应用程序。
当有一些特殊情况(例如用户未注册)时,我想要显示弹出 View Controller 。
您可以在 iPad 的 Apple Messages 应用程序中看到这一点。
有没有办法在没有第三方 Controller 的情况下做到这一点?
编辑:我找到了解决方案:在 Storyboard 中,用户可以在属性检查器的模拟指标部分设置表单。之后,使用模式转换可以打开弹出 View 。
最佳答案
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
关于ios - 类似于 iMessage 的 Split View Controller 中的弹出 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19584844/