博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
融云IMKit SDK与FDFullscreenPopGesture冲突
阅读量:6447 次
发布时间:2019-06-23

本文共 1440 字,大约阅读时间需要 4 分钟。

最近项目集成融云IMKit,发现聊天页面,选择图片-->预览--->导航栏异常,如下图

定位发现,融云RCPhotoPreviewCollectionViewController类虽然设置了隐藏导航栏,但最后被覆盖了,被覆盖位置

- (void)fd_viewWillDisappear:(BOOL)animated{    // Forward to primary implementation.    [self fd_viewWillDisappear:animated];        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{        UIViewController *viewController = self.navigationController.viewControllers.lastObject;        if (viewController && !viewController.fd_prefersNavigationBarHidden) {            [self.navigationController setNavigationBarHidden:NO animated:NO];        }    });}复制代码

处理方案

方法1.

修改UINavigationController+FDFullscreenPopGesture,过滤不处理融云RCPhotoPreviewCollectionViewController类导航栏

- (void)fd_viewWillDisappear:(BOOL)animated{    // Forward to primary implementation.    [self fd_viewWillDisappear:animated];        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{        UIViewController *viewController = self.navigationController.viewControllers.lastObject;        if (viewController && !viewController.fd_prefersNavigationBarHidden) {            NSString *classString = NSStringFromClass(viewController.class);            if ([classString isEqualToString:@"RCPhotoPreviewCollectionViewController"]) {
return;} [self.navigationController setNavigationBarHidden:NO animated:NO]; } });}复制代码

方法2.舍弃其一。

转载地址:http://rktwo.baihongyu.com/

你可能感兴趣的文章