UIImagePickerController:如何允许编辑但隐藏裁剪选项

编程入门 行业动态 更新时间:2024-10-28 21:26:18
本文介绍了UIImagePickerController:如何允许编辑但隐藏裁剪选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我想从图库中选择一张图片并为​​要求他/她取消/选择图片的用户显示预览.

I want to pick an image from the gallery and show the preview for a user asking him/her to cancel/chose the image.

我可以使用 allowsEditing 选项来实现这一点,但我想隐藏显示给用户的方形裁剪,而不是我只想在单独的视图中显示所选图像并给他一个取消或选择所选图像的选项.

I can achieve this using the allowsEditing option but I want to hide the square crop that is displayed to the user, instead I just want to show the selected image in a separate view and give him an option to cancel or chose the selected image.

推荐答案

如果您允许编辑媒体,则不能禁用裁剪"选项,但您要做的一件事是获取原始图像,即使用户裁剪选定的图像.请参阅以下文档中提到的 Apple.

You cannot disable the 'crop' option if you are allowing the editing for the media but one thing that you do is to get the original image even if the user crops a selected image. See below Apple mentioned in the documentation.

https://developer.apple/documentation/uikit/uiimagepickercontroller/infokey

使用 infoKey 获取原始图像而不是裁剪后的图像.

Use the infoKey and get the originalImage instead of the cropped.

这篇关于UIImagePickerController:如何允许编辑但隐藏裁剪选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-29 03:53:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1184037.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项   编辑   UIImagePickerController

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!