Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove the background color from the ListView group header on iOS

I enabled grouping in the ListView, and the group header has a light gray background color. How can I remove it \ make it transparent?

like image 648
Don Box Avatar asked Dec 05 '22 13:12

Don Box


1 Answers

iOS sets the default background color of Cell instances. You can change it via iOS platform-specific property:

<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>
like image 99
VahidShir Avatar answered Jun 02 '23 17:06

VahidShir