简体   繁体   English

从库中选择图片后如何启用预览?

[英]how to enable preview after selecting picture from library?

I am trying to write an app which involves picking a picture from either camera or library. 我正在尝试编写一个涉及从相机或图库中挑选图片的应用程序。 Once the picture is picked , I want to show the preview of the picture.It happens by default when camera is opted. 选好图片后,我想显示图片的预览,默认情况下选择相机时会发生。 Once the photo is clicked, it shows the user to choose or retake. 单击照片后,它将显示用户进行选择或重新拍摄。 But I want the same to be done when the picture is selected from the photo library also. 但是我也希望从照片库中选择图片时也要这样做。 Can this be done?? 能做到吗?

Ok thanks for the response. 好的,谢谢您的回复。 Here is what I did: Subclass UIImagePickerController . 这是我所做的:子类UIImagePickerController。 Upon picking an image, I am pushing another viewcontroller which is similiar to preview screen. 拾取图像后,我推动了另一个类似于预览屏幕的ViewController。 This is similiar to facebook app and so I think it will get approved by apple. 这与Facebook应用程序相似,因此我认为它将得到苹果的认可。

I may be wrong, but I think you need to implement the custom view yourself. 我可能是错的,但是我认为您需要自己实现自定义视图。 You can use the delegate callback method to get the selected image and put it on your custom view along with buttons (choose or retake). 您可以使用委托回调方法来获取选定的图像,并将其与按钮(选择或重新拍摄)一起放在自定义视图中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM