Xamarin.forms: [Bug] [iOS] Dark Mode not supported on certain controls

Created on 25 Sep 2019  路  5Comments  路  Source: xamarin/Xamarin.Forms

Description

Labels, Editors, and even Pages at least do not support dark mode by default.

I found this comment in the code, along with a clear instance of setting the color to black.

I also found this, doing much the same thing.

This prevents Dark Mode from automatically handling this control.

I don't have a comprehensive list of all the hard coded colors in the renderers, but I have at least run across these two in my own applications so far.

Obviously I can fix this with a style and some dynamic resources, as well as listening for the dark mode changed, but built in support and sane defaults should be the norm.

Steps to Reproduce

  1. Run a hello world app, with a black page background.
  2. Set your device to dark mode.
  3. See no text in your label, as it is black on black.

Expected Behavior

White text in the label when in dark mode.

Actual Behavior

Black text in the label when in dark mode.

Basic Information

  • Version with issue: 4.2.0
  • Last known good version: None
  • IDE: Visual Studio
  • Platform Target Frameworks:

    • iOS: 13.0

Bottom line is, some controls work with Dark Mode out of the box (time pickers, date pickers) and some don't. We should be consistent.

darkmode 4 iOS 13 in-progress bug

All 5 comments

Hey @adammeaney thanks for reporting. We are aware and internally we've identified all the hardcoded colors and we're going to transition them into the semantic ones.

@jfversluis Please make sure that includes the usage of MaterialColors.Light for everything in the Xamarin.Forms.Visual.Material package.

see also #7304

In regard to the ListView and cells, have a look at #7680, we might need to remove the solid white background color from a cell as a whole.

I noticed that if you leave the default Entry or Editor background color, it will be black or white depending on the iOS settings.
If we explicitly set the color, then everything will be fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hartez picture hartez  路  55Comments

dan5602 picture dan5602  路  124Comments

Sebastian1989101 picture Sebastian1989101  路  59Comments

hartez picture hartez  路  59Comments

allessandrosj picture allessandrosj  路  61Comments