我到处搜索,找不到合适的答案。有没有办法以编程方式调用imagePickerController的“编辑”照片模式(即将照片裁剪成正方形的模式)?
我问的原因是因为我有自定义叠加视图和自定义“拍照”按钮,但我想在之后编辑图像。我已将allowsEditing属性设置为YES但
[camera takePicture];
在拍摄图像后立即调用didFinishPickingMediaWithInfo。它根本不会进入“编辑”模式视图。有解决方案吗?
我的图片选择器代码:
camera = [[UIImagePickerController alloc] init];
camera.delegate = self;
camera.sourceType = UIImagePickerControllerSourceTypeCamera;
camera.cameraDevice = UIImagePickerControllerCameraDeviceRear;
camera.showsCameraControls = NO;
camera.navigationBarHidden = YES;
camera.toolbarHidden = YES;
camera.wantsFullScreenLayout = NO;
camera.allowsEditing = YES;
camera.cameraOverlayView = overlay;
编辑:添加了更多代码
答案 0 :(得分:-1)
发布您的代码,了解您如何展示imagePickerContorller
imagePicker.allowsEditing = YES;
是用于在拍摄图像后编辑图像的方法
尝试添加[cameraOverlayView setUserInteractionEnabled:NO];