Uno: Dark theme does not work for Android

Created on 10 Oct 2019  路  6Comments  路  Source: unoplatform/uno

Current behavior

Added RequestedTheme="Dark" to App.xaml, but the background is still white on Android

Expected behavior

The background should be dark.

How to reproduce it (as minimally and precisely as possible)

https://github.com/zipswich/AppDebugUno

Environment

Nuget Package:

Package Version(s):

Affected platform(s):

  • [ ] iOS
  • [x ] Android
  • [ ] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] Windows
  • [ ] Build tasks
  • [ ] Solution Templates

Visual Studio:

  • [ ] 2017 (version: )
  • [x ] 2019 (version: )
  • [ ] for Mac (version: )

Relevant plugins:

  • [ ] Resharper (version: )

Anything else we need to know?

kinbug platforandroid

All 6 comments

This problem is actually caused by the fact that some controls don't work with Background yet, I track this problem in #1674 , seems like this extends to Android as well. To fix this, please move the Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" to the root Grid:

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        ...
    </Grid>

This should do it. If I remember correctly, UWP template uses it by default, and I removed it at some point when I was porting the project.
Thank you for all the work.

This should do it. If I remember correctly, UWP template uses it by default, and I removed it at some point when I was porting the project.
Thank you for all the work.

Hi, has this problem be resolved? Can we close the issue?

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. We don't monitor discussions on closed issues thus please open a new GitHub issue if you need the team to revisit this matter.

@MartinZikmund I am sorry but I have just noticed your post. Yes, I can confirm it is working now. I just need to make sure the parent control of each page has Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"

@MartinZikmund I am sorry but I have just noticed your post. Yes, I can confirm it is working now. I just need to make sure the parent control of each page has Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"

Glad to hear 馃憤. Hopefully this limitation will be removed soon as well.

Was this page helpful?
0 / 5 - 0 ratings