开发者

UIActionSheet to choose 'Camera' or 'Photos' and then show the Camera or Photo picker

I am creating an app, in which the user will be able to choose a photo. Now I want that when the user taps a button, an UIActionSheet pops up to let the user choose if they want to use the Camera, or the Photo Library. The UIActionSheet should always be there, but the Camera option only if the device 开发者_StackOverflowhas a camera. I'm not sure if there is a standard method to do this, or if I need to implement it myself. Can anyone help me?

Thanks


You will need to build this action sheet yourself and configure it based on the presence of a camera.

Finding out if a device has camera support is easy. Check the Device Support section for more information.

Quote from the guide:

Use the isSourceTypeAvailable: method of the UIImagePickerController class to determine if the camera is available. For more information, see “Taking Pictures with the Camera.”

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜