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:
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.