Hello,
Welcome to our Microsoft Q&A platform!
For Xamarin.Android, you can change your default style from Theme.MaterialComponents.Light.DarkActionBar
to Theme.AppCompat.DayNight
in styles.xml
,
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Then use code in the MainActivity. Your application will be drakMode automatically.
AppCompatDelegate.DefaultNightMode = AppCompatDelegate.ModeNightYes;
You could refer to the native android's article like this thread(it will work in xamarin.android): developer.android.com/guide/topics/ui/look-and-feel/darktheme
For iOS, You can refer to this thread to achieve dark mode:
https://learn.microsoft.com/en-us/xamarin/ios/platform/ios13/dark-mode
Best Regards,
Leon Lu
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.