【发布时间】:2021-07-02 05:16:38
【问题描述】:
我使用此代码更改我将其放入 AppDelegate 的导航栏外观:
UINavigationBar.appearance().barTintColor = UIColor(hex: "E1354A")
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
UINavigationBar.appearance().isTranslucent = false
我还使用了以编程方式添加的 UISearchController。但是当我按下它时,导航栏和搜索控制器的颜色变为黑色。我不明白为什么会发生这种情况以及如何预防?
[][1
【问题讨论】:
-
你签入viewController了吗,你没有给self.navigation上色?
标签: ios swift uinavigationcontroller uisearchcontroller