iPhone景观问题(iPhone landscape issues)

2019-08-03 05:58发布

Xcode中:4.5.2

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

我设置我的info.plist如下:

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

当我开始我的应用程序,定向设备有风景模式,但我认为不能转动这个orienatation。

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

Answer 1:

你实现这些下面的方法。

 -(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;
    }


Answer 2:

iOS6的 ,你必须使用此方法vieworientation

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

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationMaskAll;
}


文章来源: iPhone landscape issues