[英]How do I allow an iPhone user to “Move and Scale” a photo that has already been selected
I am trying to replicate the functionality that users see when they go into edit mode for a contact for which they have already selected a photo, and then click that contact's photo. 我正在尝试复制用户在进入编辑模式时为他们已经选择了照片的联系人看到的功能,然后单击该联系人的照片。 An action sheet slides up, with options including "Take Photo", "Choose Photo", and "Edit Photo". 操作表向上滑动,选项包括“拍照”,“选择照片”和“编辑照片”。 When you select "Edit Photo", a view comes up that shows the previously selected photo, with "Move and Scale" on top of it, and Cancel and Choose buttons at the bottom. 当您选择“编辑照片”时,会出现一个视图,显示之前选择的照片,顶部有“移动和缩放”,底部有“取消”和“选择”按钮。 How do I show this "Move and Scale" view for any give UIImage? 如何为任何给出UIImage显示此“移动和缩放”视图?
To make it clear - I already have "Take Photo" and "Choose Photo" working. 为了说清楚 - 我已经有了“拍照”和“选择照片”。 And I understand how to use the UIImagePickerController with allowsEditing=YES. 我理解如何使用带有allowEditing = YES的UIImagePickerController。 I am talking about the situation where the user has already chosen a photo, and later (perhaps days or weeks later) decides they want to edit that photo. 我说的是用户已经选择了照片的情况,稍后(可能是几天或几周)决定他们想要编辑该照片。 In that case, I want to bring up the "Move and Scale" view, just as can be done in Contacts. 在这种情况下,我想调出“移动和缩放”视图,就像在“联系人”中一样。
Is there a hidden way to use the UIImagePickerController to do this? 有没有隐藏的方法来使用UIImagePickerController来做到这一点? Or some other built-in method? 还是其他一些内置方法? Or would I need to build this view myself? 或者我需要自己构建这个视图? If I need to build it myself, any pointers? 如果我需要自己构建它,任何指针?
Thanks! 谢谢!
There is no set way to do this. 没有固定的方法可以做到这一点。 You would have to roll your own. 你必须自己动手。 Theres entire apps dedicated to custom image editing as their sole purpose, so it can be done, but no prebuilt way to get to the image picker editing screen that allowsEditing = YES; Theres整个应用专用于自定义图像编辑作为其唯一目的,因此可以完成,但没有预先构建的方式来到允许编辑= YES的图像选择器编辑屏幕; gets you. 得到你。
您可以使用新的Assets Library API将图像保存到照片库,然后启动UIImagePicker并指示用户选择有问题的图像并进行gol-darnit这次编辑......但这非常难看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.