IOS8 旋转的问题

来源:互联网 发布:淘宝女士丝巾 编辑:程序博客网 时间:2024/04/30 12:59


//竖屏点击按钮 旋转到横屏

[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];

//这句话是防止手动先把设备置为横屏,导致下面的语句失效

   [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];

//横屏点击按钮, 旋转到竖屏
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];//这句话//是防止手动先把设备置为竖屏,导致下面的语句失效.
   [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];
0 0