如何摆脱移动到上一个屏幕时更改导航栏颜色的延迟


override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
self.tabBarController?.tabBar.isHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
self.navigationController?.navigationBar.shadowImage = nil
self.tabBarController?.tabBar.isHidden = false
}

点击背面(导航栏(后,我看到延迟(1.5秒(。我不明白为什么。

Func willMove from docs help me。

最新更新