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

How to solve faltering ListView in iOS and Android

$
0
0

Hi all

My app queries data from a webservice and stores the result in a list.
The list then is set as ItemsSource to the Listview.
The ItemTemplate of the ListView is set to a ViewCell where further StackLayouts (with some bound Labels) are added.
In the Stacklayouts, there are (inter alia) an image added (where the Image-SourceProperty is bound to a field in in the List with the queried data) and also a StackLayout with some “star-icons” is added (show valuation to the entry in graphical form).

As HasUnevenRows don’t work in iOS, I have to set the Height in the OnBindingContextChanged-Event to each row.

The problem is, that the ListView is faltering much in iOS and also a bit in Android (where HasUnevenRows works and I don’t have to set the Height manually), whereby it is scrolled absolutely smooth in Windows Phone.

I first tough, that the whole ListView is "pre-rendered” before showing.
I then have tried to debug the behavior at runtime (unfortunately, I only was able to fully debug at runtime on device with Windows Phone).
But it seems, as - on Windows-Phone - the ListView IS “pre-redendered” fully before showing while in iOS and Android it seems (not able to debug step by step) as only the first few rows are “pre-rendered” and the whole rest at runtime.
Means, that the images are loaded/rendered at runtime (what - I think- causes the faltering on Android and also on iOS) and in iOS additionally the Height is set at runtime (what - I think - is the main-reason for the faltering in iOS).

The faltering is not nice - especially on iOS where the scrolling normally is absolute smooth.

Questions:

  • Is there a way to force “pre-rendering” of the ListView in iOS and Android?
  • Does anybody know’s, if an improvement to this behavior is “on-the-way” in some of the next releases (especially nice would be a property “Prerendering = true/false” to the ListView ;-)?
  • Does anybody have similar problems / a solution to solve this issue?

Thanks for any feedback.


Viewing all articles
Browse latest Browse all 58056

Trending Articles