我使用這個類支持在iOS設備自動旋轉6奇怪iOS6的自動旋轉的Bug
@implementation UINavigationController (RotationIn_IOS6)
-(BOOL)shouldAutorotate
{
NSLog(@"Last Object is %@",[[self.viewControllers lastObject] description]);
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
我的應用程序設置是這樣用的導航控制器旋轉此
- 顯示密碼屏幕工作正常,這兩個(模擬器,設備)。
- 驗證用戶,並顯示主屏幕旋轉只能在模擬器不是設備
-(BOOL)shouldAutorotate
在主屏幕 任何人知道如何解決這個實施?
實際問題是什麼? – 2013-05-10 10:56:53
您是否已在您的「主屏幕」視圖控制器中實施了' - (NSUInteger)supportedInterfaceOrientations'? – 2013-05-10 11:12:30
設備的iOS版本是什麼? – 2013-05-10 11:24:50