AntBorAri
AntBorAri

Reputation: 61

CollectionView header

Xamarin.Forms version 4.2.0.848062 - iOS: iPhone 8 iOS 13.1 - Android: 9.0

In iOS => CollectionView.Header doesnt work. image => https://ibb.co/30yw2ZY

In Android works fine. image => https://ibb.co/DLQxr74

Example>>

<CollectionView ItemsSource="{Binding AllNotes}" >
    <CollectionView.Header>
        <Grid>
            <Frame OutlineColor="Black"
                        HasShadow="True"
                        CornerRadius="20" 
                        Margin="20,40"
                        HorizontalOptions="Center">
                <Label Text="Ahorrado* este mes"/>
            </Frame>
        </Grid>
    </CollectionView.Header>
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <ContentView>
                <Frame Margin="10,6" BackgroundColor="Gray" CornerRadius="20">
                    <Label Text="test" FontSize="Title"/>
                </Frame>
            </ContentView>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

Upvotes: 4

Views: 6431

Answers (1)

Lucas Zhang
Lucas Zhang

Reputation: 18861

It seems a design issue in Xamarin.Forms for iOS . You should set the CollectionView.Footer at same time . You can set the content as empty if you don't want it to show anything.

<CollectionView.Footer>
 <Grid>

 </Grid>
</CollectionView.Footer>

Upvotes: 6

Related Questions