|
<StackLayout Orientation="Vertical">
<Label Text="Header" VerticalTextAlignment="Center" HorizontalTextAlignment="Center"/>
<listView:SfListView x:Name="listView" ItemSize="70"
ItemsSource="{Binding ContactItems}"
ItemSpacing="20,0,20,0">
</listView:SfListView>
</StackLayout> |
Ah I thought that was the case. This solution doesn't work because it introduces a fixed header. I think you should be able to apply the cell spacing to only the item view cell that are not footer or header views?
Can you tell how does the SFListView calcuate an item's width?
|
<listView:SfListView x:Name="listView" ItemSize="70" ItemsSource="{Binding ContactItems}">
<listView:SfListView.HeaderTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Label BackgroundColor="Aqua" Text="Header" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</listView:SfListView.HeaderTemplate>
<listView:SfListView.ItemTemplate>
<DataTemplate>
<Grid x:Name="grid" Padding="25,0,25,0">
<Image Source="{Binding ContactImage}"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="50"/>
</Grid>
</DataTemplate>
</listView:SfListView.ItemTemplate>
</listView:SfListView> |