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 on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When items are added to the ListView's source after it's initial seed scrolling become erratic when scrolling backwards.
Open the app and scroll down for a little while, this will populate new items as you reach the bottom of the ListView.
Slowly start scrolling backwards/upwards and you will eventually see the ListView scroll start to jump around.
The jump seems to appear when the previous cell first comes into view but I could be mistaken on that.
This only appears to happen after adding items. But is making something as simple as a "Load More" at the bottom of a list view impossible.
I have tested this with static and dynamic row heights and the problem exists with all scenarios. Ive included a link to a github project that demonstrates this issue. Thanks!
PS this could be what bug ID 28061 is referring to as well.
I found the solution to this problem (but you need to set the height of the ViewCell manually or use the provided ViewCells): The ListViewRenderer.UnevenListViewDataSource (it's an internal method, so this can only be fixed by Xamarin or if you have magic hax0r skills like me) does not implement the EstimatedHeight method, therefore the height is not set for the Cells (even if you set the height for the ViewCell manually), that are in the source list, but not visible. To fix this, this method must be added:
public override nfloat EstimatedHeight (UITableView tableView, NSIndexPath indexPath)
return GetHeightForRow (tableView, indexPath);
Nice... You got a code example that i could test?
Sorry, I have no code available. This method involves patching/hacking the Xamarin.Forms.Platform.iOS.dll, so it can only be fixed by Xamarin.
Any hints what release this might end up on? Thanks!
We are trying to get this fix in 1.4.5
Should be fixed in 1.4.5-pre1
Please see an updated github project that demonstrates this behavior is still happening... Thanks
Run Project, tap button to add more rows.
Scroll to bottom.
Scroll to top to see the jumping behavior.
i took look at the new reproduction on github, it looks like you now set a Random height to the viewCell OnBindingContextChanged, different from the 1st example right?
Do you really need the Renderer for the cell or was this just a try? You can remove and cells should size as expected.
About the scrolling issue we have a way to fix it but we are looking at the performance implications to figure a solution.
Ok so I updated the project again to help clarify what I am seeing regarding cell sizing. A quick description...
1. The project has uneven rows set to true, the height is not being set anywhere and the renderer is commented out.
2. To simulate a datasource that returns diff strings for diff records in a database a random string generator was put in that creates strings of varying lengths. These varying lengths is what creates the "uneven rows"
3. Based off what I am hearing this should now work fine in 1.5, if you run the project you will see that row heights are way off.
4. If you uncomment the renderer and run the project you will see row heights get corrected, albeit very crudely.
Please let me know your thoughts, and thanks!
Forgive me for butting in, but I think your test project isn't realistic. In
your test, because each ViewCell gets recycled as the list scrolls up and down, and your ViewCell just assigns a random number to the cell's height, each cell is going to get a different height each time it comes on screen, which will cause the list to recalculate its height and do its layout again.
Most lists don't change the height of their cells as they scroll. A more
realistic test would assign random heights to the ViewModel before displaying
the list, then look up each row's height in the ViewModel based on its index in the list.
I updated the project this morning to be more realistic. It sounds like you are on a previous commit on the test project.