2014-02-26 28 views
0

我已经为我的UIImagePickerController创建了OverlayView。 有没有办法重新定位观众出现的位置?目前,浏览器一直推到设备的一侧,黑盒子填满屏幕的其余部分。重新定位相机视图

- (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]; 
} 

enter image description here

enter image description here

+0

some code n screenshot pls。 –

+0

相机有什么问题?你从相机得到的照片? –

+0

没有什么是错的图片。我只是想移动观看区域的位置。你排列你的镜头时看的部分。我想要更多的区域下来,顶部和底部有一点黑色,而不是底部的所有黑色。 –

回答

1

于是,经过了很多的样子,我碰到一些东西,让我重新定位摄影机视图以及改变它的大小终于来了。

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;