简体   繁体   English

iOS7中带有取消按钮的弹出式窗口中的UIImagePickerController

[英]UIImagePickerController within a popover with cancel button in iOS7

I'm showing a UIImagePickerController of type UIImagePickerControllerSourceTypePhotoLibrary inside a popover in iPad. 我在iPad的弹出窗口中显示了UIImagePickerController类型的UIImagePickerControllerSourceTypePhotoLibrary I initialize and present the popover like this: 我初始化并显示弹出窗口,如下所示:

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

This displays a "Cancel" button on the popover's top bar in iOS 7 right to the "Photos" title. 这将在iOS 7中弹出框的顶部栏上,在“照片”标题的右侧显示“取消”按钮。 Tapping this button does nothing and I don't find the way to handle it, how can I manage the tap event to dismiss the popover, or just remove this "Cancel" button? 轻按此按钮不会执行任何操作,我也找不到处理该按钮的方法,如何管理轻击事件以消除弹出窗口,或者只是删除此“取消”按钮?

Thanks 谢谢

You will need to add this: 您将需要添加以下内容:

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

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

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM