LLSimpleCamera是一款简单实用的可以自定义相机的控件,也支持闪光灯。可以自定义相关的按钮进行自己的想进行的操作
//创建
self.camera = [[LLSimpleCamera alloc] initWithQuality:CameraQualityPhoto];
// attach to the view and assign a delegate
[self.camera attachToViewController:self withDelegate:self];
CGFloat cameraW = [[UIScreen mainScreen] bounds].size.width;
CGFloat cameraH = [[UIScreen mainScreen] bounds].size.height - 94;
//设尺寸
self.camera.view.frame = CGRectMake(0, 0, cameraW, cameraH);
//是否允许在视图意外看
self.camera.fixOrientationAfterCapture = NO;
//判断摄像头访问权限
NSString * mediaType = AVMediaTypeVideo;
AVAuthorizationStatus authorizationStatus = [AVCaptureDevice authorizationStatusForMediaType:mediaType];
if (authorizationStatus == AVAuthorizationStatusRestricted|| authorizationStatus == AVAuthorizationStatusDenied) {
UIAlertView * alertView = [[UIAlertView alloc]initWithTitle:@”无法访问相机” message:@”请在【设置->隐私->相机】下允许访问相机” delegate:self cancelButtonTitle:@”确定” otherButtonTitles:nil, nil];
[alertView show];
}
V8HorizontalPickerView视图选择器:
self.pickerView.delegate = self;
self.pickerData = [NSArray arrayWithObjects:@”二维码”,@”身份证”,@”护照”, nil];
self.pickerView = [[V8HorizontalPickerView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 20) withDataSource:_pickerData];
self.pickerView.backgroundColor = [UIColor clearColor];
self.pickerView.selectedTextColor = [UIColor whiteColor];//147 198 228
self.pickerView.textColor = [UIColor colorWithRed:147/255.f green:198/255.f blue:228/255.f alpha:1];
self.pickerView.selectionPoint = CGPointMake(self.pickerView.frame.size.width/2, 0);