airbnb / lottie-ios

An iOS library to natively render After Effects vector animations
http://airbnb.io/lottie/
Apache License 2.0
25.76k stars 3.75k forks source link

`backgroundBehavior` doesn't seem to do anything #2242

Closed freak4pc closed 11 months ago

freak4pc commented 11 months ago

Which Version of Lottie are you using?

Lottie 4.3.3

Expected Behavior

Moving to background and then back to foreground should respect the applied backgroundBehavior

Actual Behavior

No matter what I set (I tried stop or pauseAndResume), the animation is "stuck" in a weird state and not the intiial frame, as would be expected.

https://github.com/airbnb/lottie-ios/assets/605076/13165487-4771-42f1-aac4-7a64a59a9c3c

calda commented 11 months ago

Thanks for the report. Please share a sample project that demonstrates this issue, including a description of the expected behavior.

calda commented 11 months ago

Are you using the SwiftUI LottieView or UIKit LottieAnimationView?

If you're using LottieView, perhaps you could check if this change fixes your issue: https://github.com/airbnb/lottie-ios/pull/2237

freak4pc commented 11 months ago

This is actually a UIKit LottieAnimationView, could it make any difference?

freak4pc commented 11 months ago

Hey Cal, sorry, I think this is related to some custom code we have around the view to support dark/light animations and trait collections. Closing this 🙌