7

I was experimenting with the new .net maui preview 13 and I created a new app, but for some reason the title bar on windows is looking weird enter image description here

As you can see the the title bar is grey (not white) and it is thicker than normal (normally it is as thick as the three buttons) and there is no icon like the other .net app, So is this behavior normal and if so how can I change the title bar color and size?

Note: after some investigation I discovered that this only occurs with the content page

Ahmed Fawzy
  • 309
  • 2
  • 8

3 Answers3

2

The simplest way to realize it's customize window style with windowchrome, this's An implementation example under win10

maui titlebar

mschen_
  • 21
  • 3
0

This was in error and is essentially a bug. With this PR that is now open it will be fixed and the title bar will look "normal" by default and gives you all the flexibility to style the title bar anyway you want.

This will probably be available from RC2

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100
  • 1
    MAUI has been released and the titlebar, while now of normal-ish size, is still grey. Especially when accent-colored titlebars are enabled. – Medinoc Aug 19 '22 at 14:55
-2

The height or any other size i think it depends on the platform you are running your App. I'm not sure that can be done.

But for colors you can try this. Add to App.xaml:

<Application>
    <Application.Resources>
        <ResourceDictionary>

            <Color x:Key="PrimaryColor">#242A75</Color>
            <Color x:Key="SecondaryColor">White</Color>
            ...

            <Style TargetType="NavigationPage">
                <Setter Property="BarBackgroundColor" Value="Black"></Setter>
                <Setter Property="BarTextColor" Value="{DynamicResource SecondaryColor}" />
            </Style>

            ...

        </ResourceDictionary>
    </Application.Resources>
</Application>

That will set Titlebar background color to Black, and text to your predefined SecondaryColor defined. This will apply to all the titlebars in your app.