如何在 Xamarin 窗体外壳中更改浮出控件背景颜色



使用 Xamarin Forms Shell,我正在尝试更改 Shell 和菜单项后面的背景颜色,如本教程图像所示:

https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell-images/flyout-annotated.png

我可以通过模板更改单个项目后面的颜色,但下面的空白区域以及标题和项目之间的间隙仍然是白色的。有没有办法改变这一点?

有一个名为 FlyoutBackgroundColor of shell 的属性,用于设置浮出控件的背景。

在 TheShell.xaml 中:

<Shell x:Name="theShell"
  x:Class="TailwindTraders.Mobile.Features.Shell.TheShell"
  xmlns="http://xamarin.com/schemas/2014/forms"
  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  xmlns:home="clr-namespace:TailwindTraders.Mobile.Features.Home"
  xmlns:local="clr-namespace:TailwindTraders.Mobile.Features.Shell"
  xmlns:productcategory="clr-namespace:TailwindTraders.Mobile.Features.Product.Category"
  Title="Tailwind Traders"
  Route="tailwindtraders"
  RouteHost="www.microsoft.com"
  RouteScheme="http"
  FlyoutBackgroundColor="Red"
>

最新更新