2013-10-25 34 views
0

我有應用Split View controller. 我想要彈出視圖控制器,顯示,當有一些特殊情況下(例如用戶未註冊。)。 你可以在iPad的Apple Messages應用程序中看到這個。 有沒有第三方控制器做到這一點的方法?分離視圖控制器中的彈出式視圖控制器與iMessage類似嗎?

編輯:我發現解決方案:在故事板用戶可以在模擬測量部分的屬性檢查器中設置表單表單。之後通過模態轉換可以打開彈出視圖。

回答

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

+0

'objViewController.modalPresentationStyle = UIModalPresentationFormSheet;'這行是從Treasure.Thanks關鍵! – Foriger

相關問題