0

我用 react-naive 制作了一个应用程序

“反应原生”:“0.62.0”,

“反应”:“16.11.0”,

当我将我的 android 设备置于暗模式时,我的 UI 设计受到干扰,所以我想暂时禁用它。

请帮忙。

4

1 回答 1

0

您可以通过styles.xml在您的 android 文件夹中添加此行来禁用 android 中的强制暗模式

<item name="android:forceDarkAllowed">false</item>

像这样

<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:forceDarkAllowed">false</item>
        <item name="android:textColor">#000000</item>
    </style>
</resources>
于 2021-06-25T06:40:09.903 回答