Is it possible to pop the camera (using UIImagePickerControllerSourceTypeCamera) on the iPad 2 inside of a UIPopoverController using presentModalViewController?
Whenever I do it the camera just 开发者_高级运维goes full screen. I need it inside of the UIPopoverController.
This won't work by calling presentModalViewController:animated:
. To make the camera show up in a UIPopoverController's UI, then you want something similar to the following:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.allowsEditing = YES;
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
UIPopoverController *popover = [[UIPopoverController alloc]
initWithContentViewController:imagePicker];
[popover presentPopoverFromBarButtonItem:launchCameraButton
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
There is another way to launch the popover from an arbitrary spot in your UI also. The docs should explain that.
精彩评论