先看一下官網給的圖片:
也可以在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
新聞熱點
疑難解答