簡體   English   中英

如何在 Android 的啟動活動中使用動畫圖像

[英]How to use animation images in splash activity of Android

我想做一個像這個 GIF 中那樣的飛濺活動在此處輸入圖片說明

我有一個問題:

是所有這些 GIF 文件都添加到活動中,還是所有動作都在 Android 中編碼?

我沒有在 Android 中使用動畫的經驗。 請指導我如何制作此頁面。

我的問題不是如何實施飛濺活動。 我想知道此活動中使用的圖像類型以及如何制作這些類型。 它是 GIF 還是 Lottie,我該如何制作它們? 這是平面設計師做的事情,還是我也可以做?

對於加載 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

例子

或者

當主要活動的意圖可以使用縮放飛濺時用於縮放圖片

縮放飛濺 github

依賴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 動畫

嘿結帳這個https://lottiefiles.com/blog/working-with-lottie/getting-started-with-lottie-animations-in-android-app

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM