先看一下官网给的图片:
也可以在activity中这样写:
/** app:lottie_fileName="LottieLogo2.json" * app:lottie_loop="true" */ @Override PRotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); LottieAnimationView animationView = (LottieAnimationView) findViewById(R.id.animation_view); animationView.setAnimation("LottieLogo2.json"); animationView.loop(true); }assets资源文件 这样就完成了! 本文主要是先讲述这个项目的简单使用,后续会继续学习其它的功能!
Lottie资源库
Android: https://github.com/airbnb/lottie-android
iOS: https://github.com/airbnb/lottie-ios
ReactNative: https://github.com/airbnb/lottie-react-native
新闻热点
疑难解答