Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

iOS not able to set ListView Cell Height

$
0
0

Hi,
I'm trying to set Height for cells inside ListView and it works great for Android and WP, but it doesn't work on iOS.
When using HasUnevenRows, RenderedHeight is always 40, but if I set it to false and define RowHeight it works - the problem is that I need different row height based on some rule of mine.
Does anybody have any idea how to fix this?

I've stripped my code to bare minimums and here it is:

        public class App
        {
            public static Page GetMainPage()
            {
                var list = new List<int>() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

                var listView = new ListView()
                {
                    HasUnevenRows = true,
                    ItemsSource = list,
                    ItemTemplate = new DataTemplate(() =>
                    {
                        return new ViewCell()
                        {
                            Height = 200.0,
                            View = new Label() {Text = "abc"}
                        };
                    })        
                };        
                return new ContentPage() {Content = listView};        
            }
        }

Thanks :)


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>