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

ListView, iOS, HasUnevenRows = true and ObservableCollection

$
0
0

My use case is that I'm attempting to implement an infinitely scrollable listview which has uneven rows.

I've already logged a bug regarding the behaviour of the ItemAppearing event when using hasunevenrows = true (i.e. it fires for all viewcells at load time, not when they actually show) however having worked around this issue, I have discovered another issue.

I am binding the ListView to an ObservableCollection so that I can add new items to the ListView when it scrolled within some distance of the bottom.

The problem is that when adding items to the bound ObservableCollection it breaks the ability to scroll upwards. (Items jump around and appear to have lost their calculated size).

Please note, the items do not need to be added as a result of scrolling to the end of the list. To reproduce this issue a button or any other trigger will suffice.

I think that this scenario may be a fairly common one that people will try to implement (though I may be wrong) so it might be worth a sample in the xamarin forms samples github project.. I can see 3 outcomes.

1) you may find that this is not a scenario that xamarin forms can currently support due to this issue + the itemappearing bug I have already reported, but you think it is common enough to fix

2) I have gone about this the wrong way and it works perfectly if you do it correctly (I'd welcome this one too!) or

3) its not supported and can't easily be supported the way things are


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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