页面滑动返回和点击返回按钮动做实现;

- (void)configNavbarspa

{代理

  UIViewController *vc =  self.navigationController.viewControllers[0];对象

    

    if (![vc isEqual:self]) {get

        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backButton];//自定义返回按钮it

    }io

    

    //    // 获取系统自带滑动手势的target对象class

    //    id target = self.navigationController.interactivePopGestureRecognizer.delegate;select

    //    // 建立全屏滑动手势,调用系统自带滑动手势的targetaction方法方法

    //    UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)];view

    //    // 设置手势代理,拦截手势触发

    //    pan.delegate = self;

    //    // 给导航控制器的view添加全屏滑动手势

    //    [self.view addGestureRecognizer:pan];

    //    // 禁止使用系统自带的滑动手势

    //    self.navigationController.interactivePopGestureRecognizer.enabled = NO;

    

    

    [self.navigationController.navigationBar setTitleTextAttributes:

     @{NSFontAttributeName:kFont_System_17,

       NSForegroundColorAttributeName:kColor_ThemeNavText}];

    

    self.navigationController.navigationBar.barTintColor = kColor_ThemeNavBG;//设置导航栏背景颜色

    }

相关文章
相关标签/搜索