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

Jason Smith jason.smith at xamarin.com
Fri May 6 16:48:27 UTC 2016


Hi Johan,

The estimated row height is supposed to prevent iOS from realizing
everything in your ListView, thats the reason it is there. We will need to
look into why exactly that is triggering you to get full list realization
in your case, our test case doesn't seem to trigger this effect when
HasUnevenRows = true. Also as we continue this conversation can I please
ask that you specify iOS:Cell vs Forms:Cell for clarity.

Jason

On Fri, May 6, 2016 at 1:32 AM, Johan Otterud <johan.otterud at gmail.com>
wrote:

> 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
>
> _______________________________________________
> forms-devel mailing list
> forms-devel at lists.xamarin.com
> http://lists.ximian.com/mailman/listinfo/forms-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/forms-devel/attachments/20160506/35f270a2/attachment.html>


More information about the forms-devel mailing list