iphone - 仅当在 iphone image-Picker 中完成捕获时单击捕获按钮时如何执行操作

标签 iphone objective-c ios ipad uiimagepickercontroller

在我的手机 我的应用程序 捕获图像 功能并编辑捕获的图像。

我的意图是在图像选择器上添加一个叠加层,以直观地改变裁剪矩形的尺寸[我稍后会为此烦恼]

当图像选择器打开时, View 如下所示:

enter image description here

我需要知道用户何时单击该捕获按钮

我需要执行一些操作 当用户点击捕获按钮 ( but not when the image picker appears / dismiss ) just before use the image by click use

至少 打印日志语句 NSLog(@" Capture Clicked");

最佳答案

假设您正在使用 UIImagePickerController。下面的方法将在用户选择/捕获图像后调用

   - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
        selectedImage =  [info objectForKey:UIImagePickerControllerEditedImage];
        [self editImage:selectedImage];
        //dismiss the picker
        [picker dismissModalViewControllerAnimated:YES];

    }

当然,如果您的图像处理方法需要很长时间才能返回,这将使您的应用程序无法响应。

关于iphone - 仅当在 iphone image-Picker 中完成捕获时单击捕获按钮时如何执行操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13133296/

相关文章:

iphone - cocos2d 中的 Twitter 和 facebook 集成

ios - 如何将元素向量映射到 UICollectionView 网格中?

objective-c - 什么类型的代码正确 : addSubview or direct controller assignment in AppDelegate?

ios - 带有触摸拦截器的 UIScrollView 用于 contentSize 以控制 subview

iphone - UITableView:在错误更新后从 NSInternalInconsistencyException 中恢复?

iphone - 从 id 获取 ViewController 名称并调用特定的 View 方法

iphone - 使用跨度缩放到用户位置

objective-c - NSURL 返回 Nil 值

ios - 在 iOS8 中使用 NSUrlSession 使用流请求进行后台上传

ios - 在搜索按钮上隐藏键盘单击代码创建的搜索栏