Objective c 重新定位摄影机视图

Objective c 重新定位摄影机视图,objective-c,uiimagepickercontroller,camera-overlay,Objective C,Uiimagepickercontroller,Camera Overlay,我已经为UIImagePickerController创建并覆盖了视图。 有没有办法重新定位查看器显示的位置?目前,查看器被一直推到设备的一侧,屏幕的剩余部分被一个黑匣子填满 - (IBAction)presentCameraView:(id)sender { _picker = [[UIImagePickerController alloc] init]; _picker.sourceType = UIImagePickerControllerSourceTypeCamera; // Se

我已经为UIImagePickerController创建并覆盖了视图。 有没有办法重新定位查看器显示的位置?目前,查看器被一直推到设备的一侧,屏幕的剩余部分被一个黑匣子填满

- (IBAction)presentCameraView:(id)sender {

_picker = [[UIImagePickerController alloc] init];
_picker.sourceType = UIImagePickerControllerSourceTypeCamera;

// Set flag to allow the alert to be shown
_showAlert = YES;
_endAlerts = NO;

_overlay = [[[NSBundle mainBundle] loadNibNamed:@"CameraOverlay" owner:self options:nil] objectAtIndex:0];
_picker.delegate = self;
_picker.wantsFullScreenLayout = YES;
_picker.allowsEditing = NO;
_picker.cameraOverlayView = _overlay;
_picker.showsCameraControls = NO;
[self presentViewController:_picker animated:YES completion:NULL];
}


所以,在仔细观察之后,我终于发现了一些东西,可以让我重新定位相机视图并改变其大小

CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 71.0); 
//This slots the preview exactly in the middle of the screen by moving it down 71 points

CGAffineTransform scale = CGAffineTransformScale(translate, 0.8888889, 1);
//This scales the view to the size that you want it.

_picker.cameraViewTransform = scale;

一些代码n截图。相机有什么问题?你从照相机里得到的照片?这张照片没有问题。我只是想移动到观察区域所在的位置。你在拍摄时看到的部分。我想更多的地区下来,有一个小的黑色在顶部和底部,而不是所有的黑色在底部。检查你的叠加视图,然后。。。你的overlayview必须这样设计…你想要像instagram一样的摄像头。。。正确的?