1

I want to force a white background in my NativeScript application, regardless of the device's theme. However, I haven't found a way to do this. My apps all seem to convert white background colors to dark counterparts when my Android 10 device is in dark mode.

I've tried in new projects, and even the NativeScript playground. Nothing works.

I've added CSS to root elements, disabled forceDarkMode in styles.xml, set everything to use .ns-light...the list goes on. Nothing.

Am I missing something? PLEASE tell me I'm missing something.

Max Young
  • 1,522
  • 1
  • 16
  • 42
Travis Wilson
  • 130
  • 1
  • 8
  • You may but it's not recommended. If you are not building your app for dark mode then you could opt of it - https://docs.nativescript.org/ui/dark-mode#dark-mode-for-ios – Manoj Mar 05 '20 at 23:32
  • I have tried everything in my knowledge as well, can anyone help? – Prajil Shrestha May 31 '20 at 08:19

1 Answers1

0

For iOs Manoj's link works (using Info.plist edits) - on Android I had to add this in my main.ts:

import Theme from '@nativescript/theme';

...

Theme.setMode(Theme.Light);
Tim
  • 212
  • 1
  • 7