CollectionView includes additional space at the bottom
The CollectionView height should end when its child items height ends.
The CollectionView vertically expands unnecessary even after its child elements which are populated in its ItemTemplate was ended.
https://us.v-cdn.net/5019960/uploads/editor/nq/j2wvmwhpkpa4.png
@MeikandaNayanar I think this is expected behaviour because there is not enough elements to fit your device's screen.
You are using scroll view with a grid which in turn has the second and more rows set as
<RowDefinition Height="*"></RowDefinition>
Later on the rows are set as HeightRequest="150"
which means given the Height="*"
the most each row will be is 150 units. On smaller screens you wouldn't notice this.
Hi @DPY81
Introduction to my expectation:
Documentation I have referred.
Auto — the height or width is autosized based on cell contents ("Auto" in XAML)
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/creating-mobile-apps-xamarin-forms/summaries/chapter17
The issue I am facing here:
I am expecting the layout to fit any mobile screen without any additional spaces since I have used only one grid with '*' and 'Auto' for its height. I am using the below value to make my image in the desired size (almost square) .
HeightRequest="150"
You can also see, I have added another label with that image (having height of 150). Both were in a stack layout which resides in a _DataTemplate_ of _CollectionView_ . This _CollectionView_ is fit inside the first row of a _Grid_ with height specified as '_Auto_'. So I am expecting the collection view to exactly fit the size of the _Grid_'s first row. But here there is additional space. Why? If you say this is the behavior then can you (or anyone) suggest me a way to achieve this?
This is the same as #5942?
Duplicate of #5942
@samhouts You closed this one referencing a duplicate, and then closed the duplicated referencing this as the duplicate. Apparently the default behavior of collectionview and listview is to take up all the space. There appears no way to disable this. Even on latest preview.
Or at least give us an option to shrink the collectionview if the default is to take up all the space.
If you put collectionview in a scrollview, its will then require scrolling to see anything below the collectionview, even if it would normally fit on a single "page". This prevents me from having a dynamic page that can expand as needed without confusing the user.
This is not resolved
Any update about this bug?
Most helpful comment
This is not resolved