【问题标题】:Popup view controller in Split view controller similar to iMessage?类似于 iMessage 的拆分视图控制器中的弹出视图控制器?
【发布时间】:2013-10-25 08:27:50
【问题描述】:

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

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

【问题讨论】:

    标签: ios iphone objective-c ipad ios7


    【解决方案1】:
    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

    【讨论】:

    • objViewController.modalPresentationStyle = UIModalPresentationFormSheet; 此行是宝藏的钥匙。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多