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

Created a perfect Exapandable ListView (iOS) row by NOT using ForceUpdateSize, what gives?

$
0
0

So I've been struggling with creating an expandable ListView row. It seems people have been having a lot of trouble with this in the past. Recently a new ViewCell method called "ForceUpdateSize" was added. This allowed me to create a custom ViewCell which called "ForceUpdateSize" and changed the Height on itself when a certain event was fired on the BindingContext object. This did work and the item would fold in and out but it was lagging and strange bugs would occur (iOS) where you could see other items flickering, moving up/down and so on. Also I could not change the default animations.

For those interested however I just solved this on iOS by using a CustomRenderer to get hold of the UITableView. I then stored that reference and could via another class call the method "_uiTableView.ReloadRows(...)" instead of ForceUpdateSize(). Now it works perfectly and the animation looks great + no lagging! I can also pick from all the available iOS animations.

So my question is, what is the reason for this? Is the Xamarin.Forms implementation not as simple as calling ReloadRows? Does it invalidate the full layout etc?

Anyway if you want a perfect result for now you should do similair to how I did it.


Viewing all articles
Browse latest Browse all 81910

Trending Articles



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