简体   繁体   English

如何使用相机按钮将图像选择器添加到iOS应用

[英]How to add image picker with camera button to iOS app

I'm adding a button that opens a view of the saved images on device, but also has a button to open the camera. 我要添加一个按钮,以打开设备上已保存图像的视图,但也有一个按钮来打开相机。 The iOS Facebook app currently does this. iOS Facebook应用程序当前正在执行此操作。

I've played with both AVCapture to create my own camera ui and UIImagePickerController to use the default UI but have been unable to find a view that displays both the saved images and camera button. 我已经使用AVCapture来创建自己的相机ui和使用UIImagePickerController来使用默认UI,但是无法找到同时显示已保存的图像和相机按钮的视图。

My question is, did facebook implement their own image picker or is it an Apple included library? 我的问题是,facebook是否实现了自己的图像选择器,还是Apple附带的库?

Thanks! 谢谢!

Facebook拥有自己的imagepicker子类,但这对您来说并不重要-只需为每个按钮实施一个不同的方法,即可将imagepickertype更改为UIImagePickerControllerSourceTypeCameraUIImagePickerControllerSourceTypeSavedPhotosAlbum ,然后显示选择器。

This came across this control AQPhotoPicker . 这遇到了此控件AQPhotoPicker Hopefully it will help you, it's easy to use 希望它将对您有所帮助,易于使用

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

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