Multiple controls don't support theme changes properly on the fly
See original GitHub issueDescription
If you try to change the app theme when a MAUI application is running, multiple controls will not be drawn properly. At least not on Android and Windows. I have created a sample application with all these controls:
- Search bar
- Toolbar menu
- Radio buttons
- Picker
- Checkbox
- Switch control
- Two buttons. Both are enabled, but the first one has been temporary disabled during launch. Both these should be drawn identical.
Here, I start the application on Android where the system theme is Light. Then I force the app to dark theme, and then to light theme.

Another sample on Android, but the system theme is Dark:

Here on Windows 11, the system theme is Light:

Here on Window 11, the system theme is Dark.

I see these issues:
- Search Box: On Android, the search box always uses the system colors. Even if I force my app by setting
UserAppThemeto a specific theme, the system colors will be used. On Windows, the search box could be invisible. - Toolbar menu: Always uses the color that was set on launch. Never changes on the fly. This is already reported, and there is a workaround for Android. See issue #8756.
- Radio buttons: The rings could disappear. On Windows also the text could disappear.
- Picker: On Andriod, the line in the picker could disappear. On Windows the border could disappear. I have also seen the text disappear but appear again when hovering in Windows.
- Checkbox: The border can disappear. And appear again with a different color.
- Switch control. Sometimes invisible. On Windows, the text could disappear.
- Buttons that have been disabled and then enabled again cannot change theme. This has been reported before, see #9220.
Steps to Reproduce
- Create a new MAUI application.
- Update MainPags.xaml.cs:
namespace MauiIssues;
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
Picker.ItemsSource = new List<string> { "One", "Two", "Three" };
Picker.SelectedIndex = 1;
}
override async protected void OnAppearing()
{
base.OnAppearing();
DisabledButton.IsEnabled = false;
await Task.Delay(100);
DisabledButton.IsEnabled = true;
Window.Width = 360;
Window.Height = 700;
}
private void ThemeLight_CheckedChanged(object sender, CheckedChangedEventArgs e)
{
if (ThemeLight.IsChecked)
{
App.Current.UserAppTheme = AppTheme.Light;
}
else
{
App.Current.UserAppTheme = AppTheme.Dark;
}
}
}
- Update MainPage.xaml:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiIssues.MainPage">
<ContentPage.ToolbarItems>
<ToolbarItem Order="Secondary" Text="Secondary 1" />
</ContentPage.ToolbarItems>
<Shell.SearchHandler>
<SearchHandler
Placeholder="Search box"
SearchBoxVisibility="Expanded"
>
</SearchHandler>
</Shell.SearchHandler>
<ScrollView>
<VerticalStackLayout
Spacing="12"
Padding="30"
VerticalOptions="Start">
<Label Text="Theme" />
<HorizontalStackLayout>
<RadioButton x:Name="ThemeLight" Content="Light" CheckedChanged="ThemeLight_CheckedChanged" />
<RadioButton x:Name="ThemeDark" Content="Dark" CheckedChanged="ThemeLight_CheckedChanged" />
</HorizontalStackLayout>
<Label Text="Picker:" />
<Picker x:Name="Picker" />
<Label Text="Check box:" />
<CheckBox HorizontalOptions="Start" />
<Label Text="Switch:" />
<Switch HorizontalOptions="Start" />
<Label Text="Reenabled button:" />
<Button Text="Hello world" x:Name="DisabledButton" />
<Label Text="Button:" />
<Button Text="Hello world" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
- Run the application and see what happens when the theme is changed.
Link to public reproduction project repository
https://github.com/pekspro/MauiIssues/tree/11849_Multiple_controls_dont_support_theme_changes
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, Windows, I was not able test on other platforms
Affected platform versions
Windows 11, Android 11, Android 13.
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created 10 months ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Multiple controls don't support theme changes properly on ...
NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop. - Multiple controls don't support theme ......
Read more >Theme an app - .NET MAUI
.NET Multi-platform App UI (.NET MAUI) apps can respond to style changes dynamically at runtime by using the DynamicResource markup extension.
Read more >Handle configuration changes
Handle configuration changes in your Android app. ... language, or preferred theme changes their respective values in the Configuration object.
Read more >Styles and themes | Android Developers
Styles and themes on Android let you separate the details of your app design from the UI structure and behavior, similar to stylesheets...
Read more >Just-in-Time Mode
If your CSS seems to be rebuilding in an infinite loop, there's a good chance it's because your build tool doesn't support PostCSS's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We are also affected by these issues.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 3.0(net8). Can repro on windows and android platform with sample project. 11849_Multiple_controls_dont_support_theme_changes