swift

UITabbar push 下页面的布局bug

2019-12-18  本文已影响0人  秋叶红90

UITabbar push下个页面 ,界面布局有所改变, 尽可能的布局 都在 页面出现之后更新 约束

 override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        //更新约束 比如您的键盘弹出事件 
    }

IQKeyboardManager 也有可能是这家伙影响的

 override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        //更新约束 比如您的键盘弹出事件
   let shareKeyBoard = IQKeyboardManager.shared
        shareKeyBoard.enable = ture 
    }

 override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)

        let shareKeyBoard = IQKeyboardManager.shared
        shareKeyBoard.enable = false
        if !self.isHiedKeyBoard{
            
            self.inputTextView.becomeFirstResponder()
        }
    }
上一篇下一篇

猜你喜欢

热点阅读