检测UIPopoverController何时完成呈现UIImageViewcontroller

use*_*234 3 uiimagepickercontroller uipopovercontroller ios

我有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];
Run Code Online (Sandbox Code Playgroud)

小智 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
    }
Run Code Online (Sandbox Code Playgroud)

我测试了这个,它隐藏了导航栏.我不确定这样做是否与HIG发生冲突.