融雲IMKit SDK與FDFullscreenPopGesture衝突

最近項目集成融雲IMKit,發現聊天頁面,選擇圖片-->預覽--->導航欄異常,以下圖

定位發現,融雲RCPhotoPreviewCollectionViewController類雖然設置了隱藏導航欄,但最後被UINavigationController+FDFullscreenPopGesture覆蓋了,被覆蓋位置git

- (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類導航欄 github

- (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.捨棄其一。

相關文章
相關標籤/搜索