允许用户编辑 UIImage

发布于 2024-11-13 06:26:18 字数 590 浏览 8 评论 0原文

我让用户使用 UIImagePickerController 选择图像。 生成的图像显示在 UIImageView 中。
图像下方有一个 UIButton,标题为“编辑图像”。
我的问题是,如何或在哪里呈现模式视图控制器以允许用户编辑图像?

此代码允许用户编辑她/他选择的图像...

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentModalViewController:imagePicker animated:YES];

...但我希望用户也能够在她/他选择该图像后编辑该图像。

我该怎么做呢?

也许是这样的屏幕:

I have let the user select an image using UIImagePickerController.
The resulting image is shown in a UIImageView.
There is a UIButton below the image with the title "Edit Image".
My question is, How or to where to i present modal view controller to allow the user to edit the image?

This code allows the user to edit the image s/he has chosen...

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;

[self presentModalViewController:imagePicker animated:YES];

... but i want the user to be able to edit this image after s/he has picked it as well.

How would i go about doing this?

Perhaps a screen like this:

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文