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

.NET MAUI: Disable dark mode support

This content has 8 months. 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 disable dark mode support in .NET MAUI, you need to use these code snippets in each platform

Android

In the MainApplication add the following line:

public MainApplication(IntPtr handle, JniHandleOwnership ownership) : base(handle, ownership)
{
     AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightNo;
}

iOS

In the info.plist file, add the following keyvaluepair:

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

WinUI

In the App.xaml.cs (the windows version one) add the following line:

public App()
	{
		this.InitializeComponent();
        RequestedTheme = ApplicationTheme.Light;
	}

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.