How to make UI Image Picker Controller read a custom source type in iPhone

♀尐吖头ヾ 提交于 2019-12-04 13:24:06

问题


I have to create a photo gallery app in iPhone. It should function same as the Photos app which is shipped with iPhone. But it should show the images which I package with the app.

UIImagePickerController reads only the following source types. UIImagePickerControllerSourceTypePhotoLibrary, UIImagePickerControllerSourceTypeCamera, UIImagePickerControllerSourceTypeSavedPhotosAlbum

I was thinking of adding the images bundle to the resources group in Xcode and make UIImagePickerController to read them and display.

Looking at the class references I found UIImagePickerController reads only from the resources mentioned above. Which means it can only pick the images from camera roll OR saved photo gallery OR allow user to take a pic and use it.

Does anybody know how to make UIImagePickerController read from custom source type or images?

OR

How to create a photo gallery app in iPhone :-)

Thanks, AJ


回答1:


I don't believe it is possible to make the UIImagePicker pick images from your own source. You will have to write the picker yourself (which, performance aside, doesn't seem to hard... Just a couple of UIImageViews in a UIScrollView).




回答2:


Just today I started a open source UIImagePickerController clone, it is not perfect but it works quite ok. Feel free to fork http://github.com/jeena/JPImagePickerController



来源:https://stackoverflow.com/questions/1082258/how-to-make-ui-image-picker-controller-read-a-custom-source-type-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!