MAUI UserAppTheme settings not apply to Picker/Searchbar

Viewed 39

Environment: VS 17.4 preview 1, Windows10, System Theme : Dark

To reproduce the bug:

1, Create a new Maui program.

2, added a line

        Application.Current.UserAppTheme = AppTheme.Light;

to App.xaml.cs file

3, in mainpage.xaml, build a picker and a searchbar like this:

    <StackLayout>
        <Border Stroke="Red">
            <Picker>
                <Picker.ItemsSource>
                    <x:Array Type="{x:Type x:String}">
                        <x:String>Item1</x:String>
                        <x:String>Item2</x:String>
                        <x:String>Item3</x:String>
                    </x:Array>
                </Picker.ItemsSource>
            </Picker>
        </Border>
        <Border Stroke="Blue">
            <SearchBar WidthRequest="300"
                       HeightRequest="50"
                       Placeholder="input search text"
                       TextColor="Blue" />
        </Border>
    </StackLayout>

4, Make sure your system is in Dark theme.

5, Start the program.

you can see, the picker is still in dark panel; if you move mouse over the picker, the text color is changed to WHITE, looks like it disappeared. The searchbar button is disappeared because it's white.

0 Answers
Related