我试图在我的 OverlayViewController 中将 UIImagePickerController 的框架设置为屏幕的中间 - 我创建自定义按钮的地方:
self.imagePickerController.showsCameraControls = NO;
if ([[self.imagePickerController.cameraOverlayView subviews] count] ==0)
{
CGRect overlayViewFrame = self.imagePickerController.cameraOverlayView.frame;
CGRect newFrame = CGRectMake(0.0, CGRectGetHeight(overlayViewFrame)-self.view.frame.size.height-10.0, CGRectGetWidth(overlayViewFrame), self.view.frame.size.height + 10.0);
self.view.frame = newFrame;
[self.imagePickerController.cameraOverlayView addSubview:self.view];
CGRect imagePickerControllerFrame = CGRectMake(0, topPanel.frame.size.height + 50, self.view.frame.size.width, self.view.frame.size.height - topPanel.frame.size.height - bottomPanel.frame.size.height);
self.imagePickerController.view.frame = imagePickerControllerFrame;
}
但是,它会全屏打开,并且所选图像包括顶部和底部面板下方的区域。我希望它是一个矩形。
我UIImagePickerController
从代表视图中呈现如下:
[self presentViewController:self.overlayViewController.imagePickerController animated:YES completion:nil];
怎么了?