iPhone景观问题

时间:2012-11-27 08:49:56

标签: iphone ipad ios6 uiinterfaceorientation

xcode中:4.5.2

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

我将info.plist设置如下:

初始界面方向:横向(左主页按钮)

当我启动我的应用时,定位设备具有横向模式,但我的视图不会旋转到此定向。

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

2 个答案:

答案 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;
    }

答案 1 :(得分:0)

ios6 中,您必须将此方法用于vieworientation

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

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationMaskAll;
}