Closed giantramen closed 5 years ago
Found a good solution: swapping in and out snapshots of the LOTAnimationViews.
testCell.animationView?.play(fromFrame: 60, toFrame: 60) { finished in
let snapshot = testCell.animationView?.snapshotView(afterScreenUpdates: true)
DispatchQueue.main.async {
testCell.snapshotView = snapshot
testCell.animationView?.isHidden = true
testCell.contentView.addSubviewAligned(snapshot)
}
}
@giantramen Alternatively you can set shouldRasterizeWhenIdle
to true on the Lottie Animation.
I was not seeing any performance increase when using shouldRasterizeWhenIdle
@calda i am still facing this issue in v4.0.0. Any idea how to fix this. Tried changing the rendering engine. Also tried using dotlottie.
Sharing zip files
Check these before submitting:
This issue is a:
What Platform are you on?
Expected Behavior
Scrolling should be smooth inside the collection view.
Actual Behavior
Scrolling is choppy and frames are dropped. https://vimeo.com/311323971 (This looks worse on the actual device)
Is having a bunch of LOTAnimationViews inside of collection view cells a supported use case? Is there a way I can make it less laggy?
Code Example
I am running into this issue in an actual app, this is just a mockup with a random animation to show the issue :)