react-native - 如何在React Native中强制禁用iOS暗模式

标签 react-native ios13 ios-darkmode

新的iOS 13更新引入了可选的系统范围。
这导致例如StatusBar以显示浅色文本,在白色背景上可能变得不可读。它还会破坏iOS日期时间选择器(请参见DatePickerIOS
react-native-modal-datetime-picker

最佳答案

解决方案是


将此添加到您的Info.plist文件中:


    <key>UIUserInterfaceStyle</key>
    <string>Light</string>


要么


将此添加到您的AppDelegate.m


    if (@available(iOS 13.0, *)) {
        rootView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    }

关于react-native - 如何在React Native中强制禁用iOS暗模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58395926/

相关文章:

android - "Error using newLatLngBounds(LatLngBounds, int): Map size can' t 为零...."在 Android 上使用 react-native-maps

android - React Native - 在焦点上更改按钮颜色

iOS WKWebView 在 DarkMode 中加载 PDF 数据在 PDF 文档周围有黑色背景

swift - 如何在 Xcode 中使用新的 Scene Delegate

ios - SwiftUI 如何实现暗模式切换并刷新所有 View

android - 在我滚动之前,RecyclerView 不会更新 child

javascript - react native 内置二维码生成器不工作

crash - 如何使用 [[UIApplication sharedApplication] valueForKey : @"statusBar"] on ios13? 获取 wifi 信号强度

xcode - 如何在 iOS Xcode Swift Playground 上模拟黑暗模式

ios - 深色模式不会立即更新