Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionView in VerticalStackLayout different behavior on different platforms #15148

Closed
marekm294 opened this issue May 18, 2023 · 7 comments
Closed
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@marekm294
Copy link

marekm294 commented May 18, 2023

Description

Collection View does behave differently on different plaftofm
On Android:
Android-CollectionView-Empty
Even though empty verticalStackLayout is filled
Android-VSL

On iOS
iOS-CollectionView-Empty
Empty verticalStackLayout is same as on android
iOS-VSL

On Windows:
Windows-CollectionView-Empty
Empty VerticalStackLayout is again filled.
Windows-VSL

On Mac:
Mac-CollectionView-Empty
Empty VerticalStackLayout is again filled.
Mac-VSL

There's bonus. On Mac is CollectionView filled only when app is not in full screen. When you resize app to full screen, collectionView size doesn't change. There's whitespace but it may not be visible well.

Mac-CollectionView-Empty-FullScreen

Steps to Reproduce

Use this in ContentPage

    <VerticalStackLayout>
        <CollectionView EmptyView="Empty collection" BackgroundColor="Beige"/>
    </VerticalStackLayout>

or this

    <VerticalStackLayout BackgroundColor="Beige">
    </VerticalStackLayout>

Link to public reproduction project repository

Version with bug

7.0.86

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

Windows 11, iOS 16.4.1, Android 11, Mac unknown(probably latest)

Did you find any workaround?

no

Relevant log output

No response

@marekm294 marekm294 added the t/bug Something isn't working label May 18, 2023
@hartez hartez added the s/needs-repro Attach a solution or code which reproduces the issue label May 18, 2023
@ghost
Copy link

ghost commented May 18, 2023

Hi @marekm294. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Eilon Eilon added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label May 18, 2023
@marekm294
Copy link
Author

marekm294 commented May 19, 2023

@hartez sorry, there was weird formatting in Steps to reproduce and therfore you didn't probably see code example. There's nothing more than empty collectionView in VerticalStackLayout in ContentPage. (App uses Shell but it's probably same without Shell). VerticalStackLayout images was added only as proof that VSL covers whole page and therefore the problem is probably CollectionView.
I think it should be enough but if you really need repo I can create one ofc.

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels May 19, 2023
@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 14, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.7.0 Preview 3.0. Repro on Windows 11, Android 13.0-API33 and iOS 16.4 with below Project:
15148.zip

@samhouts
Copy link
Member

In general, I would warn against putting an unconstrained CollectionView in a VerticalStackLayout. By design, VerticalStackLayout wants to expand to the height of its content, and CollectionView wants to expand to the height of its container, which leads to a horrible experience in terms of layout and performance. You're going to want to put a HeightRequest on CollectionView or use a Grid layout with a * row. Does that give you the results you expect? Thanks!

@samhouts samhouts added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Jul 18, 2023
@ghost
Copy link

ghost commented Jul 18, 2023

Hi @marekm294. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@marekm294
Copy link
Author

We found out we should use Grid instead of VSL but I expected it should have same behavior on all platforms when it's possibe to do sth like that.

@PureWeen
Copy link
Member

Duplicate of #24078

@PureWeen PureWeen marked this as a duplicate of #24078 Aug 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/needs-attention Issue has more information and needs another look s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants