首页 > 代码库 > 强制横屏和竖屏

强制横屏和竖屏

-(void)viewWillAppear:(BOOL)animated{    [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];    }-(void)viewWillDisappear:(BOOL)animated{    [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];}

放在要旋转的页面中

强制横屏和竖屏