overlay = [[UIView alloc] initWithFrame:CGRectZero];
imageView.image = nil;
if([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera])
{
picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;
picker.cameraDevice = UIImagePickerControllerCameraDeviceRear;
// picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
picker.allowsEditing = NO;
picker.showsCameraControls = NO;
picker.navigationBarHidden = YES;
picker.toolbarHidden = YES;
[picker.view addSubview:overlay];
[self presentViewController:picker animated:NO completion:nil];
}
我有一个问题,当打开相机选择器看起来像小放大但拍照时,照片与相机视图中看不完全相同。
答案 0 :(得分:0)
添加此
picker.cameraViewTransform=CGAffineTransformMakeScale(1,1);
之后
picker.sourceType = UIImagePickerControllerSourceTypeCamera;