xamarin/Xamarin.Forms

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

Aperta

#4184 aperta il 23 ott 2018

 (7 commenti) (3 reazioni) (0 assegnatari)C# (1926 fork)batch import
a/layouta/listviewe/6 :clock6:help wantedinactivep/iOS 🍎t/bug :bug:up-for-grabs

Metriche repository

Star
 (5644 stelle)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor