我有Split View controller.
的申请
我想在某些特殊情况下(例如未注册用户)显示弹出视图控制器。
您可以在iPad的Apple Messages应用程序中看到此信息。
没有第三方控制器,有没有办法做到这一点?
编辑:我找到了解决方案:在情节提要中,用户可以在属性检查器的“模拟度量”部分中设置表单。
最佳答案
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