[forms-devel] Fixing the iOS ListView when using HasUnevenRows

Johan Otterud johan.otterud at gmail.com
Fri May 6 08:32:35 UTC 2016


Hi everyone!

I began posting in gitter by Miguel asked to use the mail list so I will do
that :)

I want to discuss some fixes to the ListView for iOS. After you released
the source code I could finally get it working really well in my project.

I needed to make a listview that used elements that could collapse and
expand. It also needed recycling of cells. The current implementation has a
bug/oversight that brakes virtualization when using HasUnevenRows = true.
In the GetHeightForRow in UnevenListViewSource it will create new cells in
order to be able to measure their height. This gives really choppy and bad
performance. Also it will never realse my viewcells causing memory leaks.
This works a lot better when not using HasUnevenRows = false, but that is
not possible for many applications such as mine.

I fixed this in my implementation by getting the height directly from the
data items in the ListProxy class (by using an ICellHeight interface or
reflection). I also had to remove estimate row height to fix scrolling
issues.

Finally I made collapsing expanding work nicely by not using
ForceUpdateSize since this also contains some bugs. I do this by listening
to a INotifyPropertyChanged event for each data item in ListProxy (a
"Height" property name), I set this up in the UnevenListViewSource. I also
batch these updates together so I can make a single
tableView.ReloadRows(...) call for all the items that should expand /
collapse.

How can I help fix these issues in the official release? I understand that
things like this affect the design of the product so the way I solved it
might not be ok for the general public release.

Thanks
/Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/forms-devel/attachments/20160506/c8da27aa/attachment.html>


More information about the forms-devel mailing list