[英]Android lottie animation lags
我正在為 iOS 和 Android 開發一個應用程序。 啟動畫面有一個 JSON 動畫。 在 iOS 中,動畫效果很好,但在 Android 中,相同的動畫運行時有延遲。 有沒有人經歷過?
注意:動畫沒有任何圖像資源。
我收到了一些錯誤日志,但它們似乎無關,因為我已經嘗試了其他動畫,這些動畫運行時沒有延遲,並且顯示了相同的錯誤。
這些是錯誤:
W/LOTTIE: Lottie doesn't support layer effects. If you are using them for fills, strokes, trim paths etc. then try adding them directly as contents in your shape.
Found: [Radial Shadow]
W/LOTTIE: Animation contains merge paths. Merge paths are only supported on KitKat+ and must be manually enabled by calling enableMergePathsForKitKatAndAbove().
正如您的警告消息所說,嘗試設置enableMergePathsForKitKatAndAbove()
。
示例,在 xml 中 -
<com.airbnb.lottie.LottieAnimationView
...
...
...
app:lottie_enableMergePathsForKitKatAndAbove="true"/>
或者,在 Java 中 -
lottieAnimationView.enableMergePathsForKitKatAndAbove(true);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.