Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] SKCanvas images not rendering correctly in CollectionView #11064

Closed
Stuart88 opened this issue Jun 15, 2020 · 1 comment
Closed

[Bug] SKCanvas images not rendering correctly in CollectionView #11064

Stuart88 opened this issue Jun 15, 2020 · 1 comment
Labels

Comments

@Stuart88
Copy link

Description

SKCanvas objects render incorrectly in the last couple of cells of a larger CollectionView

The images are LaTex equations created via the CSharpMath Latex library, which utilises SkiaSharp to turn LaTex equation string into an SKCanvasView object.

So SKCanvasView is what the CollectionView is having problems with, I believe.

If I use a ListView instead, the issue does not occur.

Steps to Reproduce

  1. Bind CollectionView to large list of items where one of the bindings is to an SKCanvasView (or more specifically a MathView from the CSharpMath.Forms library)
  2. View page containing the list of items
  3. Scroll to end of list

Expected Behavior

Items rendered correctly

Actual Behavior

Last item(s) of list show repeat of first item(s)

Information

  • Version with issue: 4.6.0.847 (latest)
  • Last known good version: Unknown
  • IDE: VS2019
  • Platform Target Frameworks: Net Standard 2.0
    • Android: 9.0
  • Nuget Packages: CSharpMath.Forms 0.4.2

Screenshots

image

image

image

Reproduction Link

The following branch can be built to see the issue in action

https://github.com/Stuart88/pure-physicist/tree/wip/collection-view-problem

To locate the issue in the app (Android), navigate to:
Menu -> Topics -> Classical Mechanics -> Equations

Relevant files:

XAML page containing the CollectionView
https://github.com/Stuart88/pure-physicist/blob/wip/collection-view-problem/PurePhysicist/PurePhysicist/Views/Topics/EquationsViewBase.xaml

Code-behind
https://github.com/Stuart88/pure-physicist/blob/wip/collection-view-problem/PurePhysicist/PurePhysicist/Views/Topics/EquationsViewBase.xaml.cs

Workaround

Currently using ListView instead

@samhouts
Copy link
Member

First, nice app!

Second, I strongly suspect you're hitting the same problem that is described here: #9200 (comment)

ListView is not as good as CollectionView is at virtualization. That's good because your app will be much more responsive. The tradeoff is that you need to be explicit about the bindings for complex templates.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants