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

Unable to change ListView/CollectionView height using layout flags #6882

Closed
alexeystrakh opened this issue Jul 15, 2019 · 1 comment
Closed
Labels
a/collectionview a/listview Problems with the ListView/TableView s/unverified New report that has yet to be verified t/bug 🐛

Comments

@alexeystrakh
Copy link

Description

ListView and CollectionView controls are trying to take as much space as possible providing no control over this behavior to an end-user. The only working option as of now is to calculate the control height based on the number of items and each item height which is not always a good option. The image attached reflects the issue, with free space after ListView.Footer which should be given to the next control in StackLayout/FlexView.

Steps to Reproduce

  1. Put a ListView into a StackLayout among other controls
  2. Bind the ListView to a list of items with uneven row height and fewer items needed to fill a page (3-4 items)
  3. Set the VerticalOptions = Start

Expected Behavior

The ListView control takes space only needed to render 3-4 items and leave the rest to the other controls in the StackLayout control

Actual Behavior

The ListView control takes all space available leaving an empty space after the footer instead of giving this space to the other controls in the StackLayout control

Basic Information

  • Version with issue: 4.1.0.581479
  • Last known good version: N/A
  • IDE: VS for Mac 8.2
  • Platform Target Frameworks:
    • iOS: 12.2
    • Android: 9.0
  • Nuget Packages:
- Affected Devices: All tested

Screenshots

f0c990e4-24dd-44c4-8f07-f8ef577d4068

Reproduction Link

I have created a sample project to reproduce this issue here:
https://github.com/alexeystrakh/xamarin-listview-dynamicheight

I have also found a few references on the Internet about the same issue our community is trying to solve:
https://xamarinsharp.com/2017/05/16/listview-height-issue-in-xamarin-forms-how-to-solve-it/

@alexeystrakh alexeystrakh added s/unverified New report that has yet to be verified t/bug 🐛 labels Jul 15, 2019
@samhouts samhouts added a/collectionview a/listview Problems with the ListView/TableView labels Jul 17, 2019
@samhouts
Copy link
Member

Duplicate of #6451

@samhouts samhouts marked this as a duplicate of #6451 Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/collectionview a/listview Problems with the ListView/TableView s/unverified New report that has yet to be verified t/bug 🐛
Projects
None yet
Development

No branches or pull requests

2 participants