Skip to content

RefreshView makes CollectionView use all available vertical space despite VerticalOptions=Center on CollectionView #14479

@janseris

Description

@janseris

Description

When CollectionView has VerticalOptions=Center set, it takes up vertical space as a sum of height of all its items + margin etc.
When placed in a RefreshView, it takes the whole available space unexpectedly.

Note:

  • when setting VerticalOptions=Center on RefreshView, the CollectionView does not show at all
  • workarounds such as wrapping CollectionView in <Grid> or <ContentView> did not help

image

Steps to Reproduce

  1. Run app

To observe correct behavior, remove the RefreshView.

image

Link to public reproduction project repository

https://github.com/janseris/MauiRefreshViewStretchesCollectionViewVerticallyBug
Note: there is Task.Delay(4000) in UserService which mocks loading the data. Because of that, loading will take 4 seconds.

Version with bug

7.0 (current)

Last version that worked well

7.0 (current)

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 12 (but probably all)

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewarea-controls-refreshviewRefreshViewarea-layoutStackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenterplatform/androidplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions