Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change text/icon color in top bar

Tags:

maui

.net-maui

How do I change the color of the text and icon's in the very top bar. I want to change the backgroundcolor of that bar to a light color, which I know how to do, I can't figure out how to make the text/icon's darker.

enter image description here

like image 852
oshirowanen Avatar asked Oct 17 '25 12:10

oshirowanen


1 Answers

You can use StatusBarBehavior from MAUI toolkit package, as a Behavior at a ContentPage level:

<ContentPage.Behaviors>
    <toolkit:StatusBarBehavior StatusBarColor="LightGreen" StatusBarStyle="DarkContent" />
</ContentPage.Behaviors>

or by calling the provided methods:

CommunityToolkit.Maui.Core.Platform.StatusBar.SetColor(Colors.LightGreen);
CommunityToolkit.Maui.Core.Platform.StatusBar.SetStyle(StatusBarStyle.DarkContent);

StatusBarBehavior docs

like image 158
Cfun Avatar answered Oct 20 '25 06:10

Cfun



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!