-(void)landscapeAndPortraitChange{
UIInterfaceOrientation status = [[UIApplication sharedApplication]statusBarOrientation];
if (UIInterfaceOrientationIsPortrait(status)) {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];
} else{
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];
}
}
网友评论