I am trying to display a list containing some elements, and I just want to give a little space between these elements.
I will tell you about this, but I could not find the answer that worked for me. Here is a solution that I found that has the same result as I did, but did not work: https://stackoverflow.com/a/165189/
I am using xamarin forms 2.3.2.127, and I would like to leave xaml for that.
My xaml code:
<pages:MainXaml.Content>
<ListView x:Name="AccountsList"
ItemsSource="{Binding Items}"
SeparatorVisibility="None"
BackgroundColor="Gray">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<StackLayout BackgroundColor="White" Margin="0,0,0,20" >
<Label Text="{Binding Name}"
VerticalTextAlignment="Center"
LineBreakMode="TailTruncation"
/>
<Label Text="{Binding Amount}"
VerticalTextAlignment="Center"
LineBreakMode="TailTruncation"/>
</StackLayout>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</pages:MainXaml.Content>
I tried at intervals, Padding and Marging, none of them worked.
Visual Result / Expected:

thank
source
share