Nativescript Dark Mode Issue: App Converts into Dark Mode even if it is made for Light Mode only in Android #9812
Replies: 6 comments 3 replies
-
@abhishekranwa Try this on main.js or TS import Theme from "@nativescript/theme";
Theme.setMode(Theme.Light); |
Beta Was this translation helpful? Give feedback.
-
@vallemar Already did this. But after opening the App when the user clicks on the Dark mode from dropdown, App changes into dark mode. Tried these steps from: But still the same issue |
Beta Was this translation helpful? Give feedback.
-
I have a draft doc about some settings in App_Resources, I believe you just need to set <item name="android:forceDarkAllowed">false</item> to prevent the default android dark mode being forced. |
Beta Was this translation helpful? Give feedback.
-
I have also the same issue, any update on this? |
Beta Was this translation helpful? Give feedback.
-
I fixed the issue by removing the imported themes in app.scss. |
Beta Was this translation helpful? Give feedback.
-
@rigor789 Its apply to disable theme, but after if user make some manual events. Like user go to another page and come back then its working as expected |
Beta Was this translation helpful? Give feedback.
-
Issue Description
This issue is happening only on Android. The App is Only made for Light Mode but when a user clicks on the Dark mode button from the dropdown the app also converts into Dark Mode. We want to disable the dark mode in the App. The App Should only be in Light Mode even if someone Presses the Dark Mode button from the Dropdown. Please see the screenshot for a better understanding of the issue.
Reproduction
To Reproduce
Open the App in android and the app is in light mode, but when the user clicks on the dark mode from the dropdown the app converts into dark mode.
Expected behavior
The App should always be in Light Mode.
Error screenshot image
In Light Mode:
In Dark Mode:
Relevant log output (if applicable)
No response
Environment
Environment :
--> tns info
✔ Getting NativeScript components versions information...
⚠ Update available for component native script. Your current version is 7.2.0 and the latest available version is 8.1.5.
⚠ Update available for component @nativescript/core. Your current version is 7.0.13 and the latest available version is 8.1.5.
✔ Component @nativescript/ios has an 8.1.0 version and is up to date.
✔ Component tns-android has a 6.5.3 version and is up to date.
"@nativescript/theme": "~2.3.0"
Please accept these terms
Beta Was this translation helpful? Give feedback.
All reactions