cameraOverlayView防止使用allowEditing进行编辑 [英] cameraOverlayView prevents editing with allowsEditing

查看:538
本文介绍了cameraOverlayView防止使用allowEditing进行编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在照片拍摄(移动和缩放)之后编辑照片在我的应用中可以使用此行:

Editing a photo after it's been taken (moving and scaling it) works fine in my app with this line:

[imagePicker setAllowsEditing:YES];

但是如果我也使用cameraOverlayView,编辑模式不再工作了。

But if I also use a cameraOverlayView, the editing mode doesn't work anymore. The screen comes up, but pan and pinch gestures don't make anything happen.

我正在使用您的平均图片选择器控制器:

I'm using your average image picker controller:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

我添加了一个摄像机重叠视图,从自定义视图控制器的视图创建:

And I add a camera overlay view, created from a custom view controller's view:

CameraOverlayViewController *overlayController = [[CameraOverlayViewController alloc] init];
UIView *overlayView = overlayController.view;
[imagePicker setCameraOverlayView:overlayView];

在IB中,该视图设置为启用用户交互和多点触摸,并且在拍摄照片时进行对焦。

In IB, that view is set up to enable user interaction and multiple touch, which allows it to zoom and focus while taking the picture. But once the picture is taken and it enters editing mode, you cannot pan or pinch to move or scale the photo.

我缺少什么?

推荐答案

您的叠加层占用了相机视图的整个空间吗?

Does your overlay take up the entire space of the camera view? If so, touches are going to the overlay instead of the view below, even if you have a transparent background.

将此方法添加到您的重叠视图中,它将忽略触摸以便将它们传递到下面的视图。 (您正在覆盖检测到触摸的UIView的方法。)

Add this method to your overlay view and it will ignore touches so that they are passed to the views below. (You are overriding a method of UIView that detects touches.)

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
{
    return NO;
}






注意:那么这个奇妙的提示,你可能还想使用这一块信息,删除你的重叠视图,在那个阶段: UIImagePicker cameraOverlayView出现在Retake屏幕上

这篇关于cameraOverlayView防止使用allowEditing进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆