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

[iOS] infinite loop when forcing update size on listview cell - bug or expected behaviour?

$
0
0

On a listview, items are rendered by an extension of the viewcell class.
Due to a layout issue on xamarin forms v4, I've overridden the OnAppearing method and simply added this.ForceUpdateSize();

on Android this appears to work reasonably as expected, but on iOS it falls into an infinite loop, constantly calling the OnAppearing method even if the list is not being touched on-screen.

example code:
protected override void OnAppearing()
{
System.Diagnostics.Debug.WriteLine($"ViewCell OnAppearing {this.Id}");
base.OnAppearing();
this.ForceUpdateSize();
}

I suppose there's some difference in the cell drawing code per platform and the iOS app keeps removing/adding the cell, hence triggering the OnAppearing event?
The ui also visibly flickers some elements in the UI and the user can't scroll while this is happening.


Viewing all articles
Browse latest Browse all 89864

Trending Articles



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