Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Animated] Repeat / loop animation #3664

Closed
axelg12 opened this issue Oct 25, 2015 · 3 comments
Closed

[Animated] Repeat / loop animation #3664

axelg12 opened this issue Oct 25, 2015 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@axelg12
Copy link

axelg12 commented Oct 25, 2015

Is there anyway to loop or repeat animations with the current Animated API ?

I wanted to have a loading icon rotating while my app is getting the necessary information, but I am only able to make it rotate once.

Regards

@dralletje
Copy link
Contributor

The .start() method takes an completion callback. In that callback you can run the animation again!

Something like this should do

  ...
  runAnimation() {
    this.state.rotateValue.setValue(0);
    Animated.timing(this.state.rotateValue, {
        toValue: 360,
        duration: 500,
    }).start(() => this.runAnimation());
  }
  ...

@muyiou
Copy link

muyiou commented Oct 27, 2015

@dralletje Doea react-native support frame animation?

@astreet
Copy link
Contributor

astreet commented Oct 27, 2015

Please use Stack Overflow and tag your question with react-native for asking these kinds of questions: http://stackoverflow.com/questions/tagged/react-native

Many people from the community hang out on Stack Overflow and will be able to see and likely also answer your question. Using Stack Overflow for questions also helps us use Github issues to keep track of bugs that need to be fixed.

@astreet astreet closed this as completed Oct 27, 2015
@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants