检测UIPopoverController何时完成呈现UIImageViewcontroller

我有UIImagePickerController作为UIPopoverController的内容视图控制器。 我需要检测popover刚刚完成时(刚刚出现)。 UIPopoverController没有任何代表。 我似乎无法find一种方法来检测UIImagePickerController以及。 (这是iPad)

有什么build议么?

// 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]; 

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 } 

我testing了这个,它隐藏了导航栏。 但我不确定这样做是否与HIG冲突。

这应该帮助:

  • UIImagePickerControllerDelegate和imagePickerController:didFinishPickingMediaWithInfo:
  • UIPopoverControllerDelegate popoverControllerDidDismissPopover

你们都有代表