AiForms.CollectionView icon indicating copy to clipboard operation
AiForms.CollectionView copied to clipboard

Padding in HCollectionView

Open andreipro1002 opened this issue 5 years ago • 1 comments

Hey, I am using the HCollectionView and I want to add padding in front of the first element and after last element. Do you know how can I achieve this?

Thanks

andreipro1002 avatar Jun 17 '19 04:06 andreipro1002

@andreipro For now, the HCollectionView hasn't how to set each side margin. But the appearance as that can be displayed by using grouping header.

<ai:HCollectionView 
    ItemsSource="{Binding ItemsSource}" 
    Spacing="4"
    IsGroupingEnabled="true"
    GroupHeaderWidth="10"
    BackgroundColor="White"
    ColumnWidth="80"
    HeightRequest="80"
    ItemTemplate="{StaticResource templateA}" >
    <ListView.GroupHeaderTemplate>
        <DataTemplate>
            <ai:ContentCell>
                <ContentView BackgroundColor="White" />
            </ai:ContentCell>
        </DataTemplate>
    </ListView.GroupHeaderTemplate>
</ai:HCollectionView>

It use the GroupHeaderWidth instead of each side margin.

ItemsSource contents is:

  • Group1
    • a actual item
    • a actual item
    • a actual item
  • Group2 (blank)

muak avatar Jun 27 '19 02:06 muak