2014-09-11 54 views
0

我有一個ViewController,它包含一個按鈕。在啓動時,我通過PI半徑旋轉窗口。在參加辦法:didFinishLanchingWithOptions函數中添加如下代碼:Popup模型視圖在旋轉的父視圖控制器中顯示黑屏

[application setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown]; 
self.window.transform=CGAffineTransformMakeRotation(M_PI); 
self.window.bounds = CGRectMake(0, 0, 320, 480); 

我希望單擊該按鈕,彈出(通過presentViewController功能)的模型圖,但我只看到一個黑色的屏幕。該按鈕單擊事件:

- (void)btnAction:(id)sender { 
    UIViewController *vc = [self.storyboard instantiate...WithIdentifier:@"modal"; 
    [self presentViewController:vc animated:YES completation:nil]; // unexpected behavior 
    // [self.navigattionController pushViewController:vc]; // expected behavior 
} 

通過調試,我知道了模態視圖的中心有一定的偏移,但我不能糾正。當我使用push segue替換它時,它具有正確的行爲。

回答

0

當你開始你的應用程序時,你會看到黑屏或點擊按鈕後顯示你的模態視圖。被稱爲黑色彈出屏幕的 。