Fix disappearing cell issue for TableView on Android #19723
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Disables the native cell recycling mechanisms in favor of the renderer/handler reuse that's already built into .NET MAUI. Adds special casing to ensure that the behavior changes only apply to TableView; similar problems may exist in ListView, but that's beyond the scope of this change.
The native cell recycling relies on information that TableView was providing unreliably, and the old implementation of GetView() was removing cell contents from existing layouts so it could add the content to layouts it was measuring - this occasionally results in cells simply disappearing after they've been laid out. These changes clean up that implementation so that the cell content shifting no longer happens.
These changes also break down the TableView's cell creation methods for easier maintenance.