如何在 Xamarin Forms Shell 中更改弹出背景颜色?

G.E*_*.E. 6 xamarin.forms

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

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

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

Jac*_*Hua 12

有一个叫做FlyoutBackgroundColorshell的属性可以让你设置弹出的背景。

在 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"

>
Run Code Online (Sandbox Code Playgroud)