美文网首页
解决隐藏隐藏导航栏导致滑动返回手势实效问题

解决隐藏隐藏导航栏导致滑动返回手势实效问题

作者: 王_凯 | 来源:发表于2017-06-01 14:30 被阅读0次
    import UIKit
    
    class RoomNormalViewController: UIViewController,UIGestureRecognizerDelegate {
    
        override func viewDidLoad() {
            super.viewDidLoad()
            view.backgroundColor = UIColor.orange
        }
        
        override func viewWillAppear(_ animated: Bool) {
            super.viewWillAppear(animated)
            //用下面注释掉的方法隐藏导航栏滑动返回手势依然会有
    //        navigationController?.navigationBar.isHidden = true
            
            //隐藏导航栏
            navigationController?.setNavigationBarHidden(true, animated: true)
            //依然保持手势
    //        navigationController?.interactivePopGestureRecognizer?.delegate = self
    //        navigationController?.interactivePopGestureRecognizer?.isEnabled = true
        }
        
        override func viewWillDisappear(_ animated: Bool) {
            super.viewWillDisappear(animated)
              navigationController?.setNavigationBarHidden(false, animated: true)
        }
    
    }
    

    相关文章

      网友评论

          本文标题:解决隐藏隐藏导航栏导致滑动返回手势实效问题

          本文链接:https://www.haomeiwen.com/subject/kmcefxtx.html