ios - 如何消除移至上一屏幕时更改导航栏颜色的延迟?

标签 ios swift uikit

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 将从 docs 移动帮助我。

关于ios - 如何消除移至上一屏幕时更改导航栏颜色的延迟?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51650445/

相关文章:

ios - 如何在 Alamofire 中使用相同的 API 函数 .PUT 请求更新 JSON

ios - 是否可以从 iphone 打开 apple watch 应用程序

swift - 隐藏 NSSearchField 的 lupe 图标

swift - "If"带有可选值的语句不起作用

iphone - 如何单独使用代码创建 PickerView(无 xib)

ios - 信奇短信验证SINVerificationErrorDomain Code=3

ios - CollectionView 编程滚动

objective-c - UISlider - 当拇指触地时选择

android - Kotakt.io Beacon - 仅识别/获取/扫描您自己的信标的最佳方式?

ios - UIManagedDocument vs NSManagedObject : Performance