React Native 0.62.2 外观返回错误的配色方案

2024-02-22

在 iOS 模拟器 (13.3) 和 Android 10 上

我有一个问题Appearance and useColorScheme当我设置黑暗模式时,它仍然返回“亮”。

import { useColorScheme, Appearance } from 'react-native';

const colorScheme = useColorScheme();
console.log(colorScheme, Appearance.getColorScheme()) // "light", "light"

难道我做错了什么?


我发现了问题。

与此拉取请求相关的问题https://github.com/facebook/react-native/commit/f7b90336be25b78935549aa140131d4d6d133f7b https://github.com/facebook/react-native/commit/f7b90336be25b78935549aa140131d4d6d133f7b- 当调试器处于活动状态时,您将始终获得“轻”主题。只要关闭调试器,一切都会好起来的。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

React Native 0.62.2 外观返回错误的配色方案 的相关文章

随机推荐