2012-11-27 90 views
0

xcode:4.5.2iPhone风景问题

我想在iPad中创建一个应用程序;

我设置我的info.plist如下:

初始界面方向:横向(左home键)

当我开始我的应用程序,定向设备有风景模式,但我认为不旋转这种行为。

我不知道它是什么,谁可以帮我

+0

您是否制作在横向模式XIB? – Murali

+0

1.您是在实际设备还是模拟器中运行它? 2.你打扫和建造了吗? 3.你在视图控制器中处理了旋转吗? – Raptor

+0

是的,我都完成了,我用“故事板”来创建 –

回答

0

是您实现这些下面的方法。

-(BOOL)shouldAutomaticallyForwardAppearanceMethods{ 
     // This method is called to determine whether to 
     // automatically forward appearance-related containment 
     // callbacks to child view controllers. 
     return YES; 

    } 
    -(BOOL)shouldAutomaticallyForwardRotationMethods{ 
     // This method is called to determine whether to 
     // automatically forward rotation-related containment 
     // callbacks to child view controllers. 
     return YES; 
    } 
0

iOS6的你必须使用这种方法vieworientation

-(BOOL)shouldAutorotate 
{ 
    return YES; 
} 
-(NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskAll; 
} 

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation 
{ 
    return UIInterfaceOrientationMaskAll; 
}