ios - 检测 UIPopoverController 何时完成呈现 UIImageViewcontroller

标签 ios uiimagepickercontroller uipopovercontroller

我将 UIImagePickerController 作为 UIPopoverController 的内容 View Controller 。我需要检测弹出窗口何时刚刚完成呈现(刚刚出现)。 UIPopoverController 对此没有任何委托(delegate)。我似乎也找不到检测 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];

最佳答案

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 冲突。

关于ios - 检测 UIPopoverController 何时完成呈现 UIImageViewcontroller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18831764/

相关文章:

ios - 将 rect 从一个系统转换到另一个系统

ios - iPhone : Puzzling difference in cellForRowAtIndexPath behaviour between iOS 6 and 5. 1

xcode - iPad - 在 iPad 上关闭全屏模态视图 Controller 后,屏幕部分不再接收触摸事件

ios - Apple Watch 套件在启动时加载数据

swift - 如何使用 applicationdidBecomeActive 函数呈现 ViewController(但有一些异常(exception))?

iphone - 从 iPhone 的视频库中选择视频

ios - 如何区分didFinishPickingMediaWithInfo中的UIImagePickerController

iphone - iOS:创建无边框弹出窗口

ios - 如何让 UIPopoverController 自动改变它的箭头方向

ios - 如何以编程方式将 SubView 添加到水平 StackView 以创建条纹?