iOS开发-FDFullscreenPopGesture冲突导航栏无法隐藏

问题描述

FDFullscreenPopGesture是iOS平台上很方便使用左滑手势退出的三方库,在使用FDFullscreenPopGesture会出现与其他三方库冲突,导航栏隐藏不了,或者按钮都显示。

看一遍源码了解其实现,解决这种冲突问题。


处理方法

修改源码

源码是通过交换push方法实现,若想不影响某个视图,就直接调用原push
方法就可以了。

- (void)fd_pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
   
    if ([self isKindOfClass:[你的导航栏类 class]]) {
   
        [self fd_pushViewController:viewController animated:animated];
        return;
    }

https://github.com/forkingdog/FDFullscreenPopGesture/issues/12


不修改源码

1.查看堆栈调用

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
  * frame #0: 0x00000001010fa608 FastDemo`-[UINavigationController(self=0x000000010384ac00, _cmd="setFd_viewControllerBasedNavigationBarAppearanceEnabled:", enabled=YES) setFd_viewControllerBasedNavigationBarAppearanceEnabled:] at UINavigationController+FDFullscreenPopGesture.m:200 [opt]
    frame #1: 0x00000001010fa5d0 FastDemo`-[UINavigationController(self=0x000000010384ac00, _cmd=<unavailable>) fd_viewControllerBasedNavigationBarAppearanceEnabled] at UINavigationController+FDFullscreenPopGesture.m:193 [opt]
    frame #2: 0x00000001010fa28c FastDemo`-[UINavigationController(self=0x000000010384ac00, _cmd=<unavailable>, appearingViewController=<unavailable>) fd_setupViewControllerBasedNavigationBarAppearanceIfNeeded:] at UINavigationController+FDFullscreenPopGesture.m:139 [opt]
    frame #
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值