如何使用自定义视图控制器扩展 UIImagePickerController?
因为 UIImagePickerController 的默认裁剪框(使用设置 setAllowsEditing:YES
时)对我来说不合适,所以我创建了一个自定义视图控制器,如建议的 此处。
当从 UIImagePickerController 选择缩略图时,我从 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
打开此自定义视图控制器 (navigationController
) :
[popoverController setContentViewController:navigationController animated:YES];
但似乎 UIImagePickerController 已经关闭,因为自定义视图控制器没有动画呈现。当我取消自定义视图控制器时,我无法返回到 UIImagePickerController 的缩略图视图。有没有办法扩展 UIImagePickerController 以便在取消自定义视图控制器时返回到 UIImagePickerController ?
谢谢!
Because the default cropping frame of an UIImagePickerController (when using the setting setAllowsEditing:YES
) isn't the right size for me I've created a custom view controller, like suggested here.
When a thumbnail is selected from the UIImagePickerController I open this custom view controller (navigationController
) from - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
:
[popoverController setContentViewController:navigationController animated:YES];
But it seems that the UIImagePickerController is already closed, because the custom view controller is presented without animation. And when I cancel the custom view controller I can't go back to the UIImagePickerController's thumbnail view. Is there a way to extend the UIImagePickerController so you return to the UIImagePickerController when canceling the custom view controller?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIImagePickerController 是一个 UINavigationController。这意味着您可以根据需要将内容推送到堆栈中或将其弹出。无需设置新的视图控制器,只需将控制器推入图像选择器堆栈即可。
UIImagePickerController is a UINavigationController. That means you can push and pop things onto the stack all you want. Instead of setting a new view controller, just push your controller onto the image picker stack.