.NET MAUI: Disable dark mode support
by
banditoth
June 19, 2024
MAUI
0
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;
}
Tags In
Share
Leave a Reply Cancel reply
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Hi, I am András,
I am a seasoned software engineer from Budapest, Hungary with a strong focus on mobile app development using .NET MAUI and Xamarin.Forms. My expertise also extends to website building for my happy customers and other complex system designing. I am passionate about developing well-organized, maintainable software solutions.
#tagged
.net core (8)
.NET MAUI (26)
android (20)
Appstore (3)
azure (4)
azure devops (6)
bug (3)
ci (3)
dark mode (3)
devops (5)
entry (6)
error (13)
forms (4)
ios (15)
json (3)
keystore (2)
listview (3)
macos (8)
maui (32)
maui error (4)
maui ios (4)
maui packages (4)
mvvm (3)
nuget (4)
osx (3)
osx visual studio (3)
pipelines (4)
Publish (4)
publish error (3)
recurrencetoolkit (4)
release (2)
sourcetree (3)
styles (2)
uwp (5)
visual studio (10)
visual studio mac (3)
vs mac (4)
white screen (2)
windows (4)
xamarin (50)
xamarin android (17)
xamarin error (11)
xamarin forms (34)
xamarin ios (6)
xaml (3)