iPhone landscape issues

我怕爱的太早我们不能终老 提交于 2019-12-20 07:26:25

问题


xcode:4.5.2

I want to create an application in iPad;

I settings my info.plist as below:

Initial interface orientation: Landscape (left home button)

When I started my app, the orientation device have landscape mode, but my view not rotate to this orienatation.

I don't know what it is, who can help me


回答1:


are you implements these following methods.

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



回答2:


In ios6 you have to use this method for vieworientation

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

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationMaskAll;
}


来源:https://stackoverflow.com/questions/13580386/iphone-landscape-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!