如下图所示,MAUI中Windows下的标题栏是灰色的,如何更改颜色,找了很久,在GitHub上的issue中找到了答案,
找到/Platforms/Windows/App.xaml
<maui:MauiWinUIApplication
...(此处省略)
>
<!--添加以下部分-->
<Application.Resources>
<ResourceDictionary>
<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush>
</ResourceDictionary>
</Application.Resources>
</maui:MauiWinUIApplication>
更多的用法参考以下链接
https://github.com/dotnet/maui/issues/7123
https://github.com/dotnet/maui/pull/5811
https://learn.microsoft.com/en-us/windows/apps/develop/title-bar?tabs=winui3#full-customization