iPhone Camera - Choose from Library or Take Photo

2019-04-11 23:27发布

问题:

Please look at the image below !!

So in this image... You can see a pop-up from the bottom which gives the user 3 options when he 'taps' the 'Camera' button.

What is that view ? Is it a modal view controller which gets dismissed when an option is selected ?

Edit:

So it is UIActionSheet ! I have one more question on this, but StackOverflow would love it if I could edit the question rather than putting up a new one.

So yes.. The option "Take Photo" uses the UIImagePickerController, and the "Cancel" button is the resignFirstResponder... What about "Choose From Library" ? How do I access the photos in the iphone photo library ? Any sample code ?

Thanks !

回答1:

UIActionSheet



回答2:

This is standard UIActionSheet control

Edit: Images from library can also be accessed using UIImagePickerController. For that you need to set picker's sourceType proprety to UIImagePickerControllerSourceTypePhotoLibrary (Check class reference for more details and for all sourceType values)