xamarin/Xamarin.Forms

ListView iOS - height isn't updated if a child's visibility changed

Open

#4,184 opened on Oct 23, 2018

 (7 comments) (3 reactions) (0 assignees)C# (1,926 forks)batch import
a/layouta/listviewe/6 :clock6:help wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Repository metrics

Stars
 (5,644 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Description

ListView on iOS is still a nightmare... Having a sub element inside the cell's dataTemplate which has its visibility binded won't update its height... Tired of doing workaround or telling every Xamarin Forms haters that it will work someday...

Steps to Reproduce

Have a ListView bounded to a list of item where the item has a IsVisible or IsSelected property with INPC. Have a template like this :

<DataTemplate>

    <StackLayout>
        <!-- some content always visible -->
        <StackLayout IsVisible="{Binding IsVisible or IsSelected}">
            <!-- some contextual content-->
        </StackLayout>
    </StackLayout>
</DataTemplate>

You can replace the StackLayout with a Grid and rows with height="Auto" it will result the same.

Expected Behavior

The height of the cell should be updated. Or at least there should be an available property / event / method to tell the listView that a particularCell(object particularCell == SelectedItemIfNothingProvidedInParameter).

Actual Behavior

The height isn't updated and the contextual / additional content isn't displayed.

Basic Information

  • Version with issue: anyone
  • Last known good version: i don't think it ever worked once.
  • IDE: any IDE
  • Platform Target Frameworks:
    • iOS: any iOS framework
    • Android: The bug is only iOS specific.
  • Affected Devices: every iphone

Screenshots

image

Contributor guide