我正在構建一個應用程序,它只是主視圖(正常和顛倒)的肖像。 我已經在項目設置/ Plist中設置了這個設置,並且一切正常。 但是,我有幾個模態視圖可以用來顯示圖像/視頻,我希望它們能夠旋轉到所有方向。iOS 6 - 導航控制器一些視圖的景觀旋轉而其他人只有肖像
我試着爲UINavigationController添加一個類別,但沒有運氣。 我也加入到調用模式下面的代碼中的viewController:
-(BOOL)shouldAutomaticallyForwardAppearanceMethods{
return NO;
}
-(BOOL)shouldAutomaticallyForwardRotationMethods{
return NO;
}
我已經添加了下面的代碼,我想允許所有方向的模態viewControllers:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
什麼時我錯過了?有什麼建議麼?
感謝您的幫助。因此,我啓用了所有方向,然後嘗試在不想旋轉到橫向的視圖中手動設置'supportedInterfaceOrientations',並且它們仍然旋轉!我在「shouldAutoRotate」中也嘗試了yes/no,並且在這些視圖中沒有區別。 – JimmyJammed 2013-02-20 20:55:29
- (BOOL)shouldAutorotate { return NO; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationPortrait; } – 2013-02-20 20:58:41
把它放在你的視圖中,看它是否旋轉。這是我在一個項目中使用的確切代碼,其中一個vc不旋轉但其他人做 – 2013-02-20 20:59:49