UIImagePickerController:检测按下相机按钮(快门)
我想调用一个在用户按下相机快门后立即获取 NSNotification 的方法(即当“预览”选项卡栏具有“重新拍摄”和“使用”按钮时)。
我无法使用 didFinishPickingImage 方法,因为此时用户已经按下了“使用”按钮。
我已经通过 UIImagePickerController 的cameraOverlayView 属性实现了这一点(参见评论),但我想知道是否有更快的方法来“观察”此操作。
有什么想法吗?
I would like to call a method that takes an NSNotification immediately after the user presses the camera shutter (i.e when the "Preview" tab bar has the buttons "Retake" and "Use").
I can't use the didFinishPickingImage method because at this time the user has already pressed the "Use" button.
I have already implemented this by cameraOverlayView property of UIImagePickerController(see comments), but I wonder whether there are quicker ways of 'observing' this action.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要了解相机按钮按下事件,您可以为其触发
NSNotification
。还将以下方法添加到您要创建
ImagePickerViewController
的ViewController
中:我也在寻找这个问题,事件的键/名称确实很模糊。
To learn about camera button press event, you can fire a
NSNotification
for it.Also add the following method to the
ViewController
where you are creatingImagePickerViewController
:I was searching for this problem too, the key/name for the event is really obscure.
您可以在他们选择图像后显示它。
如果您不想使用该图像,则实际上不必
You CAN display it AFTER they choose the image.
If you don't want to use the image you really don't have to