iOS7中带有取消按钮的弹出框内的UIImagePickerController

时间:2014-02-21 11:33:06

标签: ios ipad ios7 uiimagepickercontroller uipopovercontroller

我在iPad中的popover中显示UIImagePickerController类型UIImagePickerControllerSourceTypePhotoLibrary。我初始化并呈现这样的popover:

popoverController = [[UIPopoverController alloc]
                               initWithContentViewController:imagePicker];
[popoverController presentPopoverFromRect:popoverRect
                                   inView:self.view
                 permittedArrowDirections:UIPopoverArrowDirectionUp
                                 animated:YES]

在iOS 7的popover顶部栏上显示“取消”按钮,直到“照片”标题。点击此按钮什么都不做,我找不到处理它的方法,如何管理点击事件以解除弹出窗口,或者只是删除这个“取消”按钮?

由于

1 个答案:

答案 0 :(得分:0)

您需要添加以下内容:

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{

//DO WHATEVER WHEN YOU PRESS CANCEL BUTTON (PROBABLY DISMISSING THE POPOVER
[picker dismissViewControllerAnimated:YES completion:NULL];

}