The new iOS 13 update introduces an optional system-wide. This causes e.g. the StatusBar to have light text, which might become unreadable on a white background. It also breaks the iOS Datetime Picker (see DatePickerIOS or react-native-modal-datetime-picker)
Dark mode using Appearance js file for this implementation. The underlying device is the sole control of which theme will be displayed in your application. Whenever you change the theme mode on the settings of your mobile device, the change should also reflect in your React Native application.
Android 10 and iOS 13 brought native support of dark mode to the most used smartphones. React Native developers always strive to deliver a top-notch user experience. With the support of dark mode in operating systems, it is now a necessity for most apps. Here we will look at different approaches to support dark mode in React Native apps.
Dark Mode is a very commonly used feature that most commonly used and famous applications have support for dark mode now. iOS and Android added dark mode support to their platforms within the last year, which means that it’s easier than ever to support this feature in your app. It is a great way to enhance the user experience for a mobile app.
The color scheme preference will map to the user's Light or Dark Mode preference on iOS 13 devices and higher. You can use the Appearance module to determine if the user prefers a dark color scheme: Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset).
Several UI libraries are available for React Native developers today. One of the most prominent is React Native Paper, a cross-platform material design for React Native. It is a collection of customizable and production-ready components for React Native, following Google’s Material Design guidelines.
The solution is to either
<key>UIUserInterfaceStyle</key> <string>Light</string>
OR
AppDelegate.m
: if (@available(iOS 13.0, *)) { rootView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight; }
In your app.json file add:
{ "expo": { ... "ios": { "infoPlist": { "UIUserInterfaceStyle": "Light" } }, }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With