2012-06-18 44 views
2

我有一個肖像只有VC呈現景觀只有VC。我很努力地看到它如何使它工作。我已經有一些運氣,調用旋轉模態VC後的動畫,但看起來有點狡猾。從肖像視圖控制器呈現一個模態景觀視圖控制器

我被iOS 4.3卡住了,所以沒有故事板。

什麼,我想是一樣的東西......

[landscapeVC setOrentation:UIDeviceOrentaionLanscape]; 
[portraitVC presentModalViewController:landscapeVC Animated:YES]; 

感謝所有幫助

回答

5

使用這portraitVC的viewDidLoad方法和shouldautorotate方法:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; 
[[self view] setBounds:CGRectMake(0, 0, 480, 320)]; 
[[self view] setCenter:CGPointMake(160, 240)]; 
[[self view] setTransform:CGAffineTransformMakeRotation(M_PI/2)]; 
+0

一些測試後事實證明,兩個VC都嵌套在另一個方向鎖定爲肖像的VC中。你不知道我是否可以在主VC上調用「shouldAutorotateToInterfaceOrientation ...」方法? –

相關問題