いくつかのアイテムを含むリストビューを表示しようとしています。これらのアイテムの間に少しのスペースを入れたいだけです。Xamarin Listview StackLayoutアイテム間のスペース
私はこのことについてGoogleに語っていますが、私にとってはうまくいく答えが見つかりませんでした。 私が望むのと同じ結果が得られましたが、うまくいきませんでした:https://stackoverflow.com/a/30827419/1845593
私はxamarinのフォーム2.3.2.127を使用しています。これについてはxamlを使いたいと思います。
私のXAMLコード:
<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>
私は間隔、パディングとMargingと試みたが、それらのどれも働きました。
ビジュアル結果/予想:
おかげ