我正在尝试为iOS 7更新应用程序,并且在我的自定义覆盖层上遇到问题。该覆盖层是一个图像,我使用它来给照片加框(无论是实时的还是使用完整分辨率版本来框定相机卷中的最终结果)。问题是,在iOS 7下,虽然底部透明,但该覆盖层提供了访问常规“拍照”按钮的权限,但由于某种原因,不允许我点击拍摄后出现的“使用照片”或“重拍”按钮。以下是调用视图控制器的代码片段:
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = YES;
// Overlay Creation
UIView* overlayView = [[UIView alloc] initWithFrame:picker.view.frame];
overlayView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"PBOverlayView.png"]];
[overlayView.layer setOpaque:NO];
overlayView.opaque = NO;
picker.cameraOverlayView = overlayView;
[self presentViewController:picker animated:YES completion:NULL];
}