How do I use [camera takePhoto] and edit using UIImagePicker - UIImagePickerController.allowsEditing = YES

南笙酒味 提交于 2019-12-06 15:42:44
enricmacias

Possible duplicate: UIImagePickerController does not show edit screen

According to takePicture: method in Apple documentation:

Use this method in conjunction with a custom overlay view to initiate the programmatic capture of a still image. This supports taking more than one picture without leaving the interface, but requires that you hide the default image picker controls.

Calling this method while an image is being captured has no effect. You must wait until the associated delegate object receives an imagePickerController:didFinishPickingMediaWithInfo: message before you can capture another picture.

It seems that this approach (custom overlay) it is configured in order to be managed by yourself. Even if "allowsEditing = YES" the taken picture will be directly sent to imagePickerController:didFinishPickingMediaWithInfo:.

Based on that if we want to edit the taken picture using our custom user interface we should create an according custom edit screen for that purpose.

For future reference:

The problem of not showing the Edit screen is associated with the camera.showCameraControls = NO; the presence or absence of overlay has nothing to do with it (as the current accepted answer states)

Possible workaround: on your IBAction [camera takePicture] set them again to YES. They will be shown only for a fraction of a second and that will allow the edit screen to appear. Then you will have a problem when hitting "Retake", in that case you have to capture that action via delegate and hide them again there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!