When I set ItemSpacing, it is effecting the Space between Group Headers also. I have Grid Layout listview with Multiple Group Headers.
I want the custom spacing between Group Items and Group Headers (When Collapsed). But I am not able to achieve.
I have attached the zip (with Image of my Required Listview Layout)
I tried the approache suggested in https://www.syncfusion.de/forums/133474/itemspacing-affects-header-template-margins
but it didnt work.
Below is my ListView:
<StackLayout HorizontalOptions="Fill" VerticalOptions="FillAndExpand">
<syncfusion:SfListView
x:Name="listView"
AllowGroupExpandCollapse="True"
GroupHeaderSize="30"
GroupHeaderTemplate="{StaticResource GroupHeaderTemplate}"
HorizontalOptions="Fill"
ItemSize="50"
ItemSpacing="5"
ItemTemplate="{StaticResource TemplateSelector}"
ItemsSource="{Binding FilteredKiosks}"
SelectedItem="{Binding SelectedKiosk, Mode=TwoWay}"
SelectedItemTemplate="{StaticResource SelectedTemplateSelector}"
SelectionGesture="Tap"
SelectionMode="Single">
<syncfusion:SfListView.LayoutManager>
<syncfusion:GridLayout SpanCount="6" />
</syncfusion:SfListView.LayoutManager>
<syncfusion:SfListView.Behaviors>
<prismBehaviors:EventToCommandBehavior
Command="{Binding ItemTappedCommand}"
EventArgsConverter="{StaticResource sfItemTappedEventArgsConverter}"
EventName="ItemTapped" />
</syncfusion:SfListView.Behaviors>
</syncfusion:SfListView>
</StackLayout>
Below is my one of the ItemTemplate:
<?xml version="1.0" encoding="utf-8" ?>
<ViewCell
x:Class="QNPL.Mobile.KioskMonitor.Views.Template1"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:kioskConvert="clr-namespace:QNPL.Mobile.KioskMonitor.Convertors;assembly=QNPL.Mobile.KioskMonitorModule"
xmlns:controls="clr-namespace:QNPL.Mobile.KioskMonitor.CustomControls;assembly=QNPL.Mobile.KioskMonitorModule">
<controls:NeedAssistanceView>
<StackLayout
HorizontalOptions="Center"
Spacing="0">
<StackLayout HorizontalOptions="Center" VerticalOptions="Start">
<Label
FontAttributes="Bold"
FontSize="8"
Text="{Binding isNew}"
TextColor="Black" />
</StackLayout>
<StackLayout HorizontalOptions="Center" VerticalOptions="CenterAndExpand">
<StackLayout.Resources>
<ResourceDictionary>
<kioskConvert:KioskIdConvertor x:Key="kioskIdConvertor" />
</ResourceDictionary>
</StackLayout.Resources>
<Label
FontAttributes="Bold"
FontSize="20"
Text="{Binding kioskId, Converter={StaticResource kioskIdConvertor}}"
TextColor="#FF0000" />
</StackLayout>
<StackLayout HorizontalOptions="Center" VerticalOptions="End">
<StackLayout.Resources>
<ResourceDictionary>
<kioskConvert:KioskLanguageConvertor x:Key="kioskLanguageConvertor" />
</ResourceDictionary>
</StackLayout.Resources>
<Label
FontAttributes="Bold"
FontSize="8"
Text="{Binding language, Converter={StaticResource kioskLanguageConvertor}}"
TextColor="Black" />
</StackLayout>
</StackLayout>
</controls:NeedAssistanceView>
</ViewCell>
Attachment:
5_3f394ecf.zip