locked
How to Set ListView Cell height Automatically RRS feed

  • Question

  • User380796 posted

    I Have Designed a accordion view ,When i will expand listview that time Listview Items are displaying after that white space is coming.How to solve this Issue.Any suggestion Please?

    Friday, October 25, 2019 12:52 PM

All replies

  • User382871 posted

    Did you set HasUnevenRows to true? <StackLayout> <controls:CustomListView ItemsSource = "{Binding Musics}" HasUnevenRows = "true"> ... </controls:CustomListView > </StackLayout>

    Friday, October 25, 2019 2:49 PM
  • User380796 posted

    @Jarvan said: Did you set HasUnevenRows to true? <StackLayout> <controls:CustomListView ItemsSource = "{Binding Musics}" HasUnevenRows = "true"> ... </controls:CustomListView > </StackLayout>

    i have used HasUnevenRows="True".But still cells are not displaying properly.How to set cells based on screen size. using MVVM.i have wrote code like this private int columncount;

        public int Columncount
        {
    
            get {
                if (Device.RuntimePlatform == Device.UWP) 
                {
                    return 2;
                }
                else
                {
                    return 2;
                }
    
            }
        }
    
    Friday, October 25, 2019 2:54 PM
  • User382871 posted

    Here is a tutorial about Expandable ListView With MVVM Pattern, you can refer to: https://www.c-sharpcorner.com/article/xamarin-forms-expandable-listview-with-a-sub-listview-mvvm-pattern/

    Friday, October 25, 2019 3:14 PM