[英]How to use animation images in splash activity of Android
對於加載 gif,您使用的是 Lootie 文件:
第一步將行添加到gradle依賴項
implementation "com.airbnb.android:lottie:3.4.0"
2 步:
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:lottie_url="lootieFileName.json"
app:lottie_autoPlay="true"
app:lottie_loop="true"/>
最后一步下載並將文件添加到資產:如鏈接 lootie
或者
當主要活動的意圖可以使用縮放飛濺時用於縮放圖片
依賴implementation 'pro.appus:zoom-splash:1.0.0'
構建.gradle
repositories {
maven {
url 'https://dl.bintray.com/roman-voronoy/maven/'
}
}
在onCreate()
之后在活動中結束添加行
Splash.Builder splash = new Splash.Builder(this, getActionBar());
splash.perform();
你可以在你的飛濺活動中使用 lottie 動畫
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.