我試圖在我的原始viewcontorller但在較小的尺寸上在iPad上顯示UIcontroller,以便用戶能夠與後臺中的contorller以及它進行交互。這是我的目標,但即使用戶無法在後臺與控制器交互,也可以,但在後臺查看控制器是非常重要的。我試過這個代碼:可編程地顯示具有透明背景的UIViewController
controller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:controller animated:YES];
controller.view.layer.cornerRadius = 10; // this value vary as per your desire
controller.view.clipsToBounds = YES;
controller.view.frame = CGRectMake(343, 163, 316, 546.5);
這顯示控制器與設置的框架,但在後臺你看不到另一個控制器,但只是黑色。爲什麼?
看看我在這[相關問題]的答案(http://stackoverflow.com/questions/14248954/keep-a-uiview-or-uiviewcontroller-on-top-of-all-others/14249744# 14249744),其中描述瞭如何使兩個視圖控制器同時可見。 –