3

我将 UIImagePickerController 作为 UIPopoverController 的内容视图控制器。我需要检测弹出框何时刚刚完成呈现(刚刚出现)。UIPopoverController 对此没有任何委托。我似乎也找不到检测 UIImagePickerController 的方法。(这适用于 iPad)

有什么建议么?

// UIImagePickerController let's the user choose an image.
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
self.popover = [[UIPopoverController alloc] initWithContentViewController:imagePicker];
self.popover.delegate = self;
[self.popover presentPopoverFromBarButtonItem:self.openPhotosButton permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
4

2 回答 2

9

UIImagePickerDelegate 也是一个 UINavigationControllerDelegate。

您的类应实现 UINavigationControllerDelegate 并包括以下内容:

 -(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
     // [navigationController setNavigationBarHidden:YES];
      [[UIApplication sharedApplication] setStatusBarHidden:YES];  // This one works for me: OP
    }

我已经对此进行了测试,它隐藏了导航栏。我不确定这样做是否与 HIG 冲突。

于 2013-09-17T19:53:01.273 回答
1

这应该有助于:

  • UIImagePickerControllerDelegate 和 imagePickerController:didFinishPickingMediaWithInfo:
  • UIPopoverControllerDelegate popoverControllerDidDismissPopover

你有两个代表

于 2013-09-16T15:31:26.583 回答