Problem when trying to disable dark mode on Android.
See original GitHub issueHello people, I’m learning react / react native and along, making an app to practice. What is happening is that when the device’s darkmode is active it implies the colors chosen in the application (an example below). I do not intend to invest time in and do darkmode now, I would like to learn more about React, make the whole app, and then go to the more “superficial” parts and make darkmode within the config of the app itself.
Would it be possible to inhibit / prevent the device’s Dark Mode from interfering with the colors of the app?
It’s done with my app design 😥
I’m testing the app on a Xiaomi Mi 9T Pro, I also tested it on the S10 + and it didn’t happen, it seems that MiUI forces DarkMode … Thank you.
React Native version:
“react”: “16.11.0”, “react-native”: “0.62.2”,
Possible solutions that I was unable to make work.
I found the following code below talking to put in the onCreate
method of MainActivity.java
, however it does not have this method there. I don’t know where and how I can do it.
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:15
- Comments:22 (1 by maintainers)
Top GitHub Comments
Dear @RBalconi, the exact solution to turn off the force dark mode on Android is this Stack Overflow post.
@RigottiG @joan2404 @ff-joaquin-rojas @eliasjnior @inferusvv
I don’t know who you are or where you came from, but thank you, it works like a charm! You deserve all the best!