开发者

Is it possible to pop the camera on the iPad 2 inside of a UIPopoverController using presentModalViewController?

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜