切换横竖屏幕

#pragma mark -切换横竖屏幕
- (IBAction)chageViewHVClick:(id)sender {
    UIButton * button=sender;
    if (!isHengPing) {
        paraCtx.interfaceOrientation=LS_CAMERA_ORIENTATION_RIGHT;
        _interfaceOrientation = paraCtx.interfaceOrientation;
        
        NSNumber *orientationTarget = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeRight];
        [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
    }else{
        paraCtx.interfaceOrientation=LS_CAMERA_ORIENTATION_PORTRAIT;
        _interfaceOrientation = paraCtx.interfaceOrientation;
        
        NSNumber *orientationUnknown = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
        [[UIDevice currentDevice] setValue:orientationUnknown forKey:@"orientation"];
    }
    [self setCapture];
}

posted @ 2017-08-21 09:44  frounk  阅读(125)  评论(0编辑  收藏  举报