UIImagePickerController open in camera roll

亡梦爱人 提交于 2019-12-22 05:22:11

问题


Is it possible to open camera roll directly with UIImagePickerController but still have the back button to your album list?

UIImagePickerControllerSourceTypeSavedPhotosAlbum will open only the camera roll without the option to slide back to albums.


回答1:


Unfortunately, the answer is -- it's not possible. At least not through any standard interface. It might be possible to do some view hierarchy mining or method swizzling to make it happen, but then you may run afoul of the App Store submissions review.

From the Camera Programming Topics of iOS (bolded emphasis mine):

Instead of using the camera as the media source, you use the Camera Roll album or Saved Photos album, or the entire photo library.

And:

Source type To configure the picker for browsing saved media as opposed to capturing a new picture or movie, set its sourceType property to one of the saved photo sources:

Use UIImagePickerControllerSourceTypePhotoLibrary to present a browser that provides access to all the photo albums on the device, including the Camera Roll album on devices that have a camera.

Use UIImagePickerControllerSourceTypeSavedPhotosAlbum to present a browser that restricts access to the Camera Roll album on devices that have a camera, or to the Saved Photos album on devices that don’t.




回答2:


I would rather suggest you to use custom imagepickers like elcimagepicker. afer going through the code properly you can achieve the thing you want with the help of minor manipulations.




回答3:


I came across the same situation.And found a solution,here's the code.Hope it helps.

pImagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
id albumCtrller = pImagePicker.topViewController;
pImagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[pImagePicker pushViewController: albumCtrller animated: NO];

Now you can open album and have a back navigatebutton.



来源:https://stackoverflow.com/questions/21457868/uiimagepickercontroller-open-in-camera-roll

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