Andr谩s T贸th‘s professional blog
banditoth.net

Hey there 馃憢, I’m banditoth a .NET MAUI developer from Hungary.
I write about software development with .NET technologies.

You can find me on:
LinkedIn | Github | StackOverflow | X / Twitter | Threads

Xamarin.Forms: Prevent dark mode on iOS, Android

This content has 3 years. Some of the information in this post may be out of date or no longer work. Please, read this page keeping its age in your mind.

To enforce light mode on the following platforms use this code

iOS Solution

Open up you info.plist file and add the following key:

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

Android Solution

Put this code into your MainAcitivity.cs

AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;

2 responses to “Xamarin.Forms: Prevent dark mode on iOS, Android”

  1. […] Xamarin.Forms: Prevent dark mode on iOS, Android [#Xamarin #dark mode #night mode] […]

  2. […] Xamarin.Forms: Prevent dark mode on iOS, Android (Andr谩s T贸th) […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.