question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS Radio Button displays with same black coloring in Dark Mode

See original GitHub issue

Description

When an iOS device has radio buttons on the view and is in Dark Mode, the radio buttons don’t ‘appear’ to the user. If you set the BackgroundColor of the radio buttons to White then you see that they are actually being rendered but as Black color, and on the typically black background they can’t be seen.

Android correctly renders the radio button as white when in Dark Mode.

I’ve tried to find a Color setting that applies to the radio button circle and dot but none of the colors on that control have any affect.

Steps to Reproduce

  1. Create a MAUI app
  2. Add one or more radio buttons to the view
  3. Run the app on iOS with Dark mode enabled
  4. Radio buttons cannot be seen
  5. Switch device/simulator to Light mode
  6. Radio buttons can be seen
  7. Change Radio button BackgroundColor to white (or other non-black color)
  8. Run the app on iOS with Dark mode enabled
  9. Radio buttons can be seen as black against the new background color

Link to public reproduction project repository

Straightforward to reproduce with new project

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS All

Did you find any workaround?

Set Radio Button background color for dark mode to be in contrast to Black Ideally would have ability to directly interact with radio button ‘dot and circle’ coloring, but doesn’t appear to be any way to do that at the moment

Relevant log output

No logs, just visual app output

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dustin-wojciechowskicommented, Mar 21, 2023

Hello, with this last pull request, the issue should be fixed for ios.

@DanTravison

  1. I noticed in your repro that the “Light” radiobutton has TextColor in the Content section of the Radiobutton. If you move it to the <RadioButton> section, you should see the text when switching modes.
  2. If developing for Windows, try manually setting the ControlTemplate to the default template, which will make it behave more like ios rather than use the native WinUI radio button. As so: <RadioButton ControlTemplate="{x:Static RadioButton.DefaultTemplate}" /> Recent work should hopefully have this all fixed soon. Another option would be to define your own Control template where you can set AppThemeBindings directly.
  3. With this update, this will allow you to then use a ResourceDictionary where you can specify values such as: RadioButtonOuterEllipseStrokeLight/Dark, RadioButtonCheckGlyphStrokeLight/Dark and RadioButtonCheckGlyphFillLight/Dark. We still have to update documentation on this, but hopefully it will be of use to you 😃
0reactions
DanTravisoncommented, Feb 18, 2023

I have a repro at https://github.com/DanTravison/RadioButtonTheme and also see difference issues on Windows.

The result is I have not been able to use RadioButton in apps that use themes - either the background is wrong, or the text doesn’t appear, or the buttons are not visible. I would be great if the ThemingDemo app showed correct/expected usage for RadioButton. If there is one, I haven’t figured it out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NET Maui radio button text not visible in dark mode?
Yes, it is. The issue is that when setting TextColor attribute of RadioButton in Mac or iOS, it failed to change the TextColor...
Read more >
Dark Mode Text Too Dark
Dark background won't show the word cursor Although Pages support Dark Mode,but it's not the real dark mode because we cannot type in...
Read more >
Dark mode with design tokens
Learn how to implement dark mode from triggering it, to setting up design ... With a color palette that consist mainly of black...
Read more >
How to always display dark text in the status bar of an iOS ...
In applications with a white form background, dark mode sets the status bar text color to white, resulting in the text no longer...
Read more >
How to change the color of radio buttons using CSS
In this article, we are going to discuss how to change the color of the radio button using the accent-color CSS property. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found