0

大家好,我正在使用 popoverController 显示相机视图,但我没有获得相机视图任何人请帮助我这里是我的代码。

    picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls=NO;
picker.delegate = nil;
picker.allowsEditing = NO;

UIViewController *containerController = [[UIViewController alloc] init];
containerController.contentSizeForViewInPopover = CGSizeMake(768, 750);
[containerController.view addSubview:picker.view];

UIPopoverController *popover = [[UIPopoverController alloc]   initWithContentViewController:containerController];

self.popoverController = popover;          
popoverController.delegate = self;          

[popover release];          
CGPoint point = {760,750}; 
CGSize size = {760,750};

[popoverController presentPopoverFromRect:CGRectMake(point.x, point.y, size.width, size.height) 
                                   inView:self.view  permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

在这里我得到空的popoverView?视频不显示。

4

1 回答 1

1

我找不到问题。请检查此代码:

picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls=NO;
picker.delegate = nil;
picker.allowsEditing = NO;
picker.contentSizeForViewInPopover = CGSizeMake(768, 750);

UIPopoverController *popover = [[UIPopoverController alloc]   initWithContentViewController:picker];

self.popoverController = popover;          
popoverController.delegate = self;          

[popover release];          
CGPoint point = {760,750}; 
CGSize size = {760,750};

[self.popoverController presentPopoverFromRect:CGRectMake(point.x, point.y, size.width, size.height) inView:self.view  permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
于 2012-09-29T08:39:41.270 回答