简体   繁体   English

切换深色和浅色模式时导航栏和tabor不会改变他的颜色

[英]navigation bar and tabor does not change his color when switching dark and light mode

I want to change my app interface to light mode.我想将我的应用程序界面更改为浅色模式。

I implemented following code on all ViewControllers:我在所有 ViewController 上实现了以下代码:

overrideUserInterfaceStyle = .light

When I switch to dark mode, the navigation bar and tab bar change his color to black.当我切换到深色模式时,导航栏和标签栏将他的颜色更改为黑色。 The rest is still white as it should be. rest 应该是白色的。 The following image is dark mode on.下图是深色模式开启。

在此处输入图像描述

I added in the Info.plist User Interface Style to light.我在 Info.plist用户界面样式中添加了灯光。 Now it's working fine.现在它工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在明暗模式之间切换时状态栏保持黑色 - Status bar stays black when switching between light and dark mode 切换暗/亮模式时如何动态提供CGColor? - How to provide CGColor dynamically when switching dark/light mode? 如何在深色模式和浅色模式之间更改文本颜色 - How to change text color between dark mode and light mode 选项卡栏 Controller:切换到暗模式时的图标和 Colors - Tab Bar Controller: Icon and Colors when switching to dark mode iphone主题处于黑暗模式时导航栏样式更改 - navigation bar style change while iphone theme is in dark mode 从亮模式到暗模式的颜色变化在真实设备上的 SwiftUI 中不起作用 - Color change from light-mode to dark-mode not working in SwiftUI on real device 离子:无法在暗模式下更改 iOS 状态栏颜色 - Ionic: cannot change iOS status bar color in dark mode 应用程序仅支持 LIGHT MODE 但设备进入深色模式时状态栏不一致 - App supports only LIGHT MODE but status bar not consistent when device goes to dark mode SwiftUI 使用@AppStorage 更改暗/亮模式 - SwiftUI dark / light mode change with @AppStorage SwiftUI:获取动态背景颜色(暗模式或亮模式) - SwiftUI: Get the Dynamic Background Color (Dark Mode or Light Mode)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM