.NET MAUI: Disable dark mode support

To disable dark mode support in .NET MAUI, you need to use these code snippets in each platform


In the MainApplication add the following line:

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


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



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

public App()
        RequestedTheme = ApplicationTheme.Light;

Leave a Comment

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