Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 45689 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
I have ListView with HasUnevenRows = true, ListViewCachingStrategy.RecycleElement and I override `SetupContent`.
`SetupContent` is being called each time you add an item to the ListView, which makes snes, but it's called as many times as the number of items.
So if you have zero items: add one item, 'SetupContent` is called once.
Now you add a new item (there are 2 items now) `SetupContent` is called twice, one time with `index` parameter with value 0, and the second time with `index` parameter = 2
Now you add a new item (there are 3 items now) `SetupContent` is called three times (parameter `index` is 0,1 and 2 respectively)
And so on...
can you please attach a reproduction case?
Created attachment 18128 [details]
The issue is with the 'ListViewCachingStrategy.RecycleElement'.
The issue is only with the 'ListViewCachingStrategy.RecycleElement'.
Without it set, SetupContent is called once when item is added.
The test application was created in VS2015 and uses latest 22.214.171.124-pre3 but the issue is the same with the current released version 126.96.36.199.
Look to the MainPage.xaml.cs, it's the only place where code is.
Another thing I noticed:
When tapping on an item or keeping the item pressed, `SetupContent` is repeatedly called, this time for just the tapped/pressed item, but I wonder if this right. Shouldn't `SetupContent` always be called only once for an item when its cell is created?
If the override of `SetupContent` gets called so many times, I assume so is the base.
I forgot to mention that I see the issue on Android. I haven't tested it on iOS.
iOS appears to only make one call to SetupContent. Checked against the latest 188.8.131.52-nightly.