iPhone Camera - Choose from Library or Take Photo

2019-04-11 22:43发布

Please look at the image below !!

enter image description here

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 !

2条回答
时光不老,我们不散
2楼-- · 2019-04-11 23:26

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)

查看更多
Emotional °昔
3楼-- · 2019-04-11 23:40
登录 后发表回答