国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

Lottie學習(一)簡單使用--->一個可輕松實現各種動畫(SVG、Animations)的開源項目

2019-11-09 18:43:22
字體:
來源:轉載
供稿:網友

先看一下官網給的圖片:

這里寫圖片描述 這里寫圖片描述 這里寫圖片描述

Lottie引用compile 'com.airbnb.android:lottie:1.0.1'sdk最低要求: minSdkVersion 16xml配置<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="zlg.wolf.wolf_lottie.MainActivity"> <com.airbnb.lottie.LottieAnimationView android:id="@+id/animation_view" android:layout_width="wrap_content" android:layout_height="wrap_content" app:lottie_fileName="LottieLogo2.json" app:lottie_loop="true" app:lottie_autoPlay="true" /></RelativeLayout>

也可以在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


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 北辰区| 景宁| 宜兰市| 富阳市| 始兴县| 楚雄市| 新昌县| 稻城县| 子长县| 广西| 中江县| 锦屏县| 同仁县| 宜兰县| 从江县| 鹰潭市| 青神县| 邛崃市| 渝中区| 微山县| 阳曲县| 岗巴县| 鱼台县| 玛沁县| 青河县| 太仆寺旗| 万宁市| 江津市| 保康县| 新津县| 中方县| 江门市| 太原市| 比如县| 万山特区| 宁波市| 阿荣旗| 理塘县| 阜新| 无锡市| 牙克石市|