ios - 类似于 iMessage 的 Split View Controller 中的弹出 View Controller ?

标签 ios iphone objective-c ipad ios7

我有一个带有 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/

相关文章:

objective-c - 使用 gdata xml 解析带有命名空间的 xml

iphone - iOS 中的通话记录、短信记录、电子邮件记录

ios - 使用 CGImageDestinationFinalize 创建大型 GIF - 内存不足

ios - 将对象解析为 AnnonationPoints

ios - textFieldShouldReturn 未在 iOS 中调用

iphone - YouTube 收件箱不起作用

ios - 在我导入 xcassets 后, Storyboard对每张图片都有问号

ios - UILabel 创建后始终为 nil

ios - 如何在 Swift 中进行弱链接?

objective-c - 如何在不使用属性或 ivar 的情况下引用对象