从 iOS 上的 ListView 组标题中删除背景颜色

Don*_*Box 4 xamarin.forms

我在 ListView 中启用了分组,并且组标题具有浅灰色背景色。如何删除它\使其透明?

Vah*_*hir 11

iOS 设置 Cell 实例的默认背景颜色。您可以通过特定于 iOS 平台的属性更改它:

<ListView xmlns="http://xamarin.com/schemas/2014/forms"
          xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
          xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core">
  <ListView.GroupHeaderTemplate>
    <DataTemplate>
      <ViewCell ios:Cell.DefaultBackgroundColor="Transparent">
        <!--other views...-->
      </ViewCell>
    </DataTemplate>
  </ListView.GroupHeaderTemplate>
</ListView>
Run Code Online (Sandbox Code Playgroud)