iPhone landscape issues

2019-03-04 02:57发布

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

2条回答
聊天终结者
2楼-- · 2019-03-04 03:36

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;
    }
查看更多
放我归山
3楼-- · 2019-03-04 03:41

In ios6 you have to use this method for vieworientation

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

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationMaskAll;
}
查看更多
登录 后发表回答