dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
21.95k stars 1.7k forks source link

[iOS]: Picker control's border doesn't respect forced light mode #23101

Open RedZone908 opened 2 months ago

RedZone908 commented 2 months ago

Description

When the system is in dark mode yet light mode is forced via UserAppTheme = AppTheme.Light, the iOS Picker control's border remains in dark mode which leads to it being invisible amongst white backgrounds.

This is essentially the same bug as #22953 which I previously reported for Android, but at that time I had not yet tested to see if iOS was affected as well.

System Light Mode

image

System Dark Mode with Forced Light Mode In-App

image

This could be related to issue #11849 which covers multiple controls though it does not discuss iOS.

Steps to Reproduce

  1. Create a new MAUI project
  2. In App.xaml.cs,, write the constructor as follows:

    public App()
    {
    InitializeComponent();
    
    MainPage = new AppShell();
    
    UserAppTheme = AppTheme.Light;
    }
  3. Add a picker to MainPage.xaml.cs
    <Picker x:Name="picker"
            Title="Select a monkey">
    <Picker.ItemsSource>
        <x:Array Type="{x:Type x:String}">
            <x:String>Baboon</x:String>
            <x:String>Capuchin Monkey</x:String>
            <x:String>Blue Monkey</x:String>
            <x:String>Squirrel Monkey</x:String>
            <x:String>Golden Lion Tamarin</x:String>
            <x:String>Howler Monkey</x:String>
            <x:String>Japanese Macaque</x:String>
        </x:Array>
    </Picker.ItemsSource>
    </Picker>
  4. Set the iPhone/emulator to dark mode
  5. Run the app
  6. The picker's border will be invisible because it is in dark mode while the rest of the app is not.

Link to public reproduction project repository

https://github.com/RedZone908/IOSForcedLightModePickerIssue

Version with bug

8.0.60 SR6, 8.0.3 GA

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

github-actions[bot] commented 2 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

ninachen03 commented 2 months ago

Verified this original issue with Visual Studio 17.11.0 Preview 2.0 (8.0.60 ). Can repro it