Ios 忽略UIImagePickerController上的中心手势
我正在尝试定制Ios 忽略UIImagePickerController上的中心手势,ios,objective-c,uiimagepickercontroller,Ios,Objective C,Uiimagepickercontroller,我正在尝试定制UIImagePickerController。我想,当UIImagePickerController的摄像头启动时,它只会忽略所有挤压动作 以下是我尝试过的,但它不起作用:我添加了一个叠加,并识别出与之相关的捏手势。问题是,覆盖还禁用了所有其他手势: @interface ViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
UIImagePickerController
。我想,当UIImagePickerController
的摄像头启动时,它只会忽略所有挤压动作
以下是我尝试过的,但它不起作用:我添加了一个叠加,并识别出与之相关的捏手势。问题是,覆盖还禁用了所有其他手势:
@interface ViewController : UIViewController <UIImagePickerControllerDelegate, UINavigationControllerDelegate>
@property (nonatomic, strong) UIImagePickerController *picker;
@end
doPinch
是一种不执行任何操作的方法self.picker.showsCameraControls=NO代码>
在cameraOverlay
中自定义您的相机控件,您的意思是我需要自己在cameraOverlay
中实现相机控件吗?
self.picker = [[UIImagePickerController alloc] init];
self.picker.delegate = self;
self.picker.sourceType = UIImagePickerControllerSourceTypeCamera;
self.picker.showsCameraControls = YES;
CGRect screenBounds = [[UIScreen mainScreen] bounds];
screenBounds.size.height -= 100;
UIView *cameraOverlay = [[UIView alloc] initWithFrame:screenBounds];
UIPinchGestureRecognizer *pinchRec = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(doPinch)];
[cameraOverlay addGestureRecognizer:pinchRec];
[self.picker.view addSubview:cameraOverlay];