Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 261 forks source link

[iOS] Animation stops when you re-open the app from background #325

Open areimche opened 3 years ago

areimche commented 3 years ago

🐛 Bug Report

I have a CollectionView with several animations. When I put the app in the background and open it again, the animations stop. This only affects iOS, it works on Android.

This also happens when using a ListView.

Expected behavior

Animations should continue to run after reopening the app from the background.

Reproduction steps

Branch with sample code: https://github.com/areimche/LottieXamarin/tree/test_background_bug

Configuration

Version: 4.0.9

Platform:

4brunu commented 3 years ago

In Swift I had the same problem and solved it with the following change. Hope it helps.

animationView.backgroundBehavior = .pauseAndRestore
areimche commented 3 years ago

Sorry, I selected the wrong platform when creating the issue. I have the problem with Xamarin.Forms on iOS. There is no backgroundBehavior for the AnimationView.

DavidStrachanLexacom commented 3 years ago

I think I might have a similar issue, I am using Xamarin.Forms TabView (from Syncfusion). When I navigate to a different tab and back, the animation does not run and is static at the first frame.

Does this sound like the same issue you are facing @areimche ?