Coder Social home page Coder Social logo

Reset Animation about lottie-ios HOT 7 CLOSED

airbnb avatar airbnb commented on May 18, 2024
Reset Animation

from lottie-ios.

Comments (7)

nlogioco avatar nlogioco commented on May 18, 2024

Can you reset an animation by using 'animationProgress = 0.0'?

from lottie-ios.

buba447 avatar buba447 commented on May 18, 2024

@nlogioco Yeah that should work! is it not working?

from lottie-ios.

nlogioco avatar nlogioco commented on May 18, 2024

@buba447
It is. I realized if 'animationProgress' is set before 'play' it'll go to that progress spot via animation. If 'animationProgress' is set after play, it'll cancel the animation and go back to beginning and not play.

I have noticed something weird (not sure if it is by design):

animation.animationProgress = 0.9
animation.play()

Expected results v1:
Start the animation at 0% completed
End the animation at 90% completed

Expected results v1:
Start the animation at 90% completed
End the animation at 100% completed

Actual results:
Start the animation at 0% completed
End the animation at 10% completed

from lottie-ios.

buba447 avatar buba447 commented on May 18, 2024

Hmm thats very strange @nlogioco
Is the animation.animationProgress = 0.9 animation.play() happening before or after you've added it to a superview? Can I get more context?

from lottie-ios.

nlogioco avatar nlogioco commented on May 18, 2024

@buba447

I add it to the superview before setting the properties.

What would you recommend?

from lottie-ios.

buba447 avatar buba447 commented on May 18, 2024

@nlogioco I think i found a fix. I push pushed it to master.

from lottie-ios.

buba447 avatar buba447 commented on May 18, 2024

@nlogioco Please check it out and let me know if it didn't work!

#91

from lottie-ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.