How can we display the UiImagepicker controller interface with both ca开发者_StackOverflow社区mera and video mode, as it is in the default camera application on iPhone.
UIImagePickerController
has a mediaTypes
property, which is an array of types you want to support (image, video, or both):
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/occ/instp/UIImagePickerController/mediaTypes
The way it has it within the OS is that it changes the picker via a slider in the bottom toolbar.
When the value changes from photo to video via the slider, you could recreate the UIImagePickerController with the appropriate mediaType and reload the view.
I do not know if this would be as seemless as the iPhone included way of doing things without testing it, however, this would allow you to change the picker being used from one to the other.
精彩评论