React Native's cool animation library implements any AE animation lottie-react-native

lottie-react-native

portal

1.npm i --save lottie-react-native
2.react-native link lottie-ios
3.react-native link lottie-react-native

If the file Lottie.h is not found

Go to General > Embedded Binaries > add Lottie.framework

Use steps:
```js
1.1. Use Adobe After Effects software to make special effects animation;

1.2. Use the bodymovin project tool to export special effects animations in JSON format files;

1.3. Use the Lottie library to parse the JSON file and render the effect on the mobile terminal.
````

Related parameters:
js 1. source 导入json文件 2. progress 动画执行的进程 3. speed 动画执行的速度/number 4. loop 动画是否循环执行/boolean 5. autoPlay 是否自动播放/boolean 6. autoSize 是否原始大小/boolean 7. style 8. imageAssetsFolder 安卓需要配置图片资源,ios不要
Two methods of execution:
```js
componentDidMount() {

  1. 采用Animated方式
    Animated.timing(this.state.progress, {
    toValue: 1,
    duration: 5000,
    }).start();
    1. Use the library's method
      this.animation.play();
      //reset
      // this.anim.reset();
      }

```

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324914860&siteId=291194637
Recommended