简体   繁体   中英

iPad App Landscape Mode broken iOS 8.3

I have an app for iPad and the app is only landscape right and left orientation..like printscreen:

该应用程序仅横向

and I'm using the following code to rotate the view to landscape mode:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
 CGAffineTransform rotate = CGAffineTransformMakeRotation(M_PI/2);
    [self.window setTransform:rotate];
    [self.window setFrame:CGRectMake(0, 0, 768, 1024)];
}

and the xib:

Xib

It worked fine..but now in iOS 8.3 it doesn't work. It appears wrong...see the image:

在此处输入图片说明

set auto layout constraints to your viewController objects. and no need write this your code in didFinishLaunchingWithOptions

[[UIApplication sharedApplication]setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
 CGAffineTransform rotate = CGAffineTransformMakeRotation(M_PI/2);
 [self.window setTransform:rotate];
 [self.window setFrame:CGRectMake(0, 0, 768, 1024)];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM