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

Xamarin Forms IOS list view performance problem

$
0
0

I'm using simple listview in xamarin forms and populate data from sqlite database, here is big performance problem for IOS , but for android it works great. here is bit code of my listview:

            ListView listView = new ListView {
                VerticalOptions = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Start
            };
            listView.SetBinding (ListView.ItemsSourceProperty, SearchViewModel.ProductsPropertyName);
            listView.ItemTemplate = new DataTemplate (typeof(SearchItemCell));
            listView.HasUnevenRows = true;
            listView.ItemSelected += async (sender, e) => {
                if (e.SelectedItem == null)
                    return;
                _viewModel.AddProductToCart ((Product)e.SelectedItem);
                Navigation.PopAsync ();
            };

I populate data inside OnAppearing method

protected override async void OnAppearing ()
        {
            base.OnAppearing ();
            if (_viewModel.Products == null) {
                Loading loadingScreen = new Loading (true);
                await Navigation.PushModalAsync (loadingScreen);
                await Task.Run (() => {
                    _viewModel.LoadData ();
                });
                await Navigation.PopModalAsync ();
            }
        }

Viewing all articles
Browse latest Browse all 89864

Trending Articles



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