我将 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/