Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CollectionView Header, EmptyView And GridItemsLayout #10085

Closed
angelru opened this issue Mar 25, 2020 · 6 comments
Closed

[Bug] CollectionView Header, EmptyView And GridItemsLayout #10085

angelru opened this issue Mar 25, 2020 · 6 comments

Comments

@angelru
Copy link

angelru commented Mar 25, 2020

Description
When I use a CollectionView with Header and EmptyView with GridItemsLayout,
the design looks bad, I think GridItemsLayout should only affect ItemTemplate and not the CollectionView object.

Steps to Reproduce

<CollectionView ItemsSource="{Binding lists}">
                <CollectionView.ItemsLayout>
                    <GridItemsLayout Orientation="Vertical" Span="3" />
                </CollectionView.ItemsLayout>
      <CollectionView.EmptyView>
                    <StackLayout>
                        <Label Text="No data!"
                       Margin="10,25,10,10"
                       FontAttributes="Bold"
                       FontSize="18"
                       HorizontalOptions="Fill"
                       HorizontalTextAlignment="Center" />
                    </StackLayout>
                </CollectionView.EmptyView>
    <CollectionView.Header>
        <StackLayout>
            <Label Text="Header"
                FontSize="Medium"
                HorizontalOptions="Center"/>
        </StackLayout>
    </CollectionView.Header>
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <Label Text="{Binding .}"/>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

Expected Behavior
GridItemsLayout should not affect Header, EmptyView or Footer, only ItemTemplate.

Actual Behavior
GridItemsLayout affect Header, EmptyView, Footer and ItemTemplate.

Basic Information
Version with issue: vs 16.5
IDE: vs 16.5.0
Affected Devices: Android Emulator
OS: Windows 10 without hyper-V

if we remove GridItemsLayout everything works fine

@angelru angelru added s/unverified New report that has yet to be verified t/bug 🐛 labels Mar 25, 2020
@hartez
Copy link
Contributor

hartez commented Mar 25, 2020

@angelru Can you post some screenshots so we can see the layout you are getting?

@PureWeen PureWeen added s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Mar 25, 2020
@angelru
Copy link
Author

angelru commented Mar 26, 2020

With GridItemsLayout:
Sin título

Without GridItemsLayout
Sin título1

GridItemsLayout should not affect Header, EmptyView or Footer, only ItemTemplate.

@hartez @PureWeen

@samhouts samhouts added a/collectionview p/Android and removed s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. s/needs-repro ❔ This reported issue doesn't include a sample project reproducing the issue. Please provide one. labels Apr 10, 2020
@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Apr 20, 2020

Attached repro sample.
Issue10085.zip

cv-layout-issue-small

The size of the header and EmptyView changes based on the Span value of GridItemsLayout.
ezgif-3-13f02d31e6d1

@jsuarezruiz jsuarezruiz removed the s/unverified New report that has yet to be verified label Apr 20, 2020
@angelru
Copy link
Author

angelru commented Jul 14, 2020

Any updates?

@angelru
Copy link
Author

angelru commented Mar 23, 2021

ping @jsuarezruiz

@Colinkl
Copy link

Colinkl commented Jan 31, 2023

Any workaround is available?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Archived in project
Development

No branches or pull requests

6 participants