I have a listview getting elements from a list, the problem that I have is that first item has to have a differentmargin from the second item, like in the image below:
The even items should be Margin="20,0,0,0" and the odd Margin="0,0,0,0.
My listview is created like this:
<ListView ItemsSource="{Binding items}" HasUnevenRows="True" ItemTapped="ListView_OnItemTapped">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid HorizontalOptions="StartAndExpand" VerticalOptions="StartAndExpand" ColumnSpacing="0" RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="564"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<forms:CachedImage x:Name="Imagebe" Grid.Row="0" DownsampleToViewSize="True" HeightRequest="80" WidthRequest="564" Source="{Binding Img}" Margin="0,0,0,0">
<forms:CachedImage.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1" ></TapGestureRecognizer>
</forms:CachedImage.GestureRecognizers>
</forms:CachedImage>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
