Closed
Description
Lottie-ios Issue
Hello! Sorry you are having an Issue! Please help us make Lottie better by filling everything below out with as much information as you can so we can try to reproduce and fix the issue!
Check these before submitting:
- Updated to the latest (2.1.3) version of LottieThe issue doesnt involve and Unsupported FeatureThis issue isnt related to another open issue
This issue is a
- Non-Crashing (Visual or otherwise) BugCrashing BugFeature RequestRegression (Something that once worked doesnt work anymore)
What Platform are you on?
- MacOS (Specify Platform Version)iOS (Specify Platform Version)
Expected Behavior
(Screenshots encouraged)
Actual Behavior
(Screenshots encouraged)
Code Example
Animation JSON
Adding the animation JSON helps us debug the issue faster!
Activity
GeekSprite commentedon Nov 10, 2017
I set loopAnimation to YES ,it works fine frist,but when I pressed the home button,and then back the app, the animation stopped
DarthMike commentedon Nov 21, 2017
+1
I think it would be nice to have this as a controllable flag, so the view could handle the pause/resume if it was playing when entering background and becoming active.
BTW thanks for a great project!
plguyim commentedon Nov 23, 2017
+1
I think it is base on Core animation, so .... how to fix it?
mchangxe commentedon Nov 23, 2017
seeing this same problem... Added an animation as subview to an UIView object, loop is on yes but the animation disappears after a few seconds...
GeekSprite commentedon Dec 4, 2017
@Eziooooo In Core Animation ,set CAAnimation removeOnCompletion = NO; can solve this problem, but this don't work for lottie...
wucanqi commentedon Dec 12, 2017
+1 the same problem , emmmmmmmm, so .... somebody tell how to fix plz......
ghost commentedon Dec 15, 2017
In viewdidappear you can check isAnimationPlaying property. If Its false call [animationView play]
devnull0000 commentedon Dec 21, 2017
+1 the same problem
GeekSprite commentedon Jan 5, 2018
@Brsoyan It wont't work, come to foreground, UIViewController will not call viewdidappear,
but you can observe system Notification --UIApplicationWillEnterForegroundNotification ,but it is kind of stupid.
ezequieloliveiralima commentedon Jan 20, 2018
I have the same problem, and I have downgraded to V 2.0.3:
pod 'lottie-ios', '2.0.3'
Worked for me...
Osama92 commentedon Feb 12, 2018
Just implemented viewDidLayoutSubview() method, put the animation within the method and it works fine. Thank you!
Agenric commentedon Mar 9, 2018
I tried to hook
play
method in the category'sload
method and added a listener toUIApplicationDidEnterBackgroundNotification
andUIApplicationDidBecomeActiveNotification
notifications to solve this problem.But I don’t know if this will have any risk, or do you have any suggestions?
hezhk3 commentedon Apr 8, 2018
Maybe it's stopping for saving energy.
Just observe UIApplicationWillEnterForegroundNotification in your view controller
adhamali450 commentedon Jun 28, 2018
Hey!
I had the same problem which is the animation disappear when i leave the page where the animation is located and come back to it later
i solved it although i work on Lottie.Forms but the solution is generic it gonna work for each one of you.
there is some event fired when the animation page loads right regardless your platform is right?
you subscribe to this event and do this:
remove the animation view implemented earlier
insert a new animation object within the same place
it's not very friendly to the performance but it woks since there is no official solution from Lottie themselves
ghost commentedon Jul 4, 2018
Have you tried to program a simple delay? My animation was stopping after the first play, then I did:
and it started working. Hope it helps!
21 remaining items