iPhone Camera - Choose from Library or Take Photo

旧巷老猫 提交于 2019-12-12 08:58:15

问题


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)



来源:https://stackoverflow.com/questions/6611598/iphone-camera-choose-from-library-or-take-photo

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