Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to effectively disable Dark Mode theming in Nativescript?

I tried to add

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

to App_Resources/iOS/Info.plist

But the app still is with dark mode, even after rebuilding it and deleting hooks, node_modules and platforms.

I'm using tns preview --bundle.

like image 818
Gabriel S. Avatar asked Jan 08 '20 02:01

Gabriel S.


2 Answers

Not sure what can be happening with your code but it is really supposed to work. I have been using it until last update (when we finally had time to handle dark mode).

You should also be able to force light mode with

import Theme from "@nativescript/theme";

Theme.setMode(Theme.Light);

Source: https://github.com/NativeScript/theme

like image 79
Doud Avatar answered Sep 21 '22 02:09

Doud


In addition to the plist I did (with Nativescript theme installed)

Page class="ns-light"

Worked for me on iOS 13.1

like image 22
codeBasePlusPlus Avatar answered Sep 22 '22 02:09

codeBasePlusPlus