Xamarin.Android Dark mode not working for Dialogs and Pickers

Pardeep Sharma 21 Reputation points
2022-05-16T04:09:52.273+00:00

We have implemented dark mode in Xamarin.Forms to target Android and iOS. It works fine in iOS but dialogs and pickers don't respect the System Dark mode updates (Android).

I tried inheriting the base style via:

<style name="MainTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
  </style>

OR

 <style name="MainTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  </style>

But none of the above changes are working. Please suggest if it's a bug in Xamarin.Android framework.

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-05-17T02:48:40.47+00:00

    Hello,​

    Please update your Xamarin.Forms nugget package to the latest. Then change the parent of <style> to parent="MainTheme.Base" or parent="Theme.AppCompat.DayNight"

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.