Lottie 动画库 Z 排序问题

Sub*_*sed 11 android z-order android-animation lottie-android

我目前正在玩适用于 Android的 AirBnB 的 Lottie,但我在LottieAnimationViewZ 排序方面遇到了问题。无论我是否将 LottieAnimationView 放在 的顶部RelativeLayout,它总是出现在布局中的所有其他元素之上,例如:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="@dimen/spacing_lrg"
    tools:context="com.myapp.SplashActivity">

    <com.airbnb.lottie.LottieAnimationView
        android:id="@+id/animation_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:lottie_fileName="test.json"/>

   <! -- Other Elements that should appear on top of the background animation -->

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我也尝试将LottieAnimationView的高程设置为 0,但没有成功解决问题。有没有人知道如何解决这个问题,或者这只是图书馆的限制?另外,如果是限制,是什么原因造成的?

编辑:

这可能已在库更新中修复,因为此问题发生在库的早期版本中(因为这是在 2 年前发布的)。我会验证是否是这种情况,如果是这样,我会接受一些东西来关闭这篇文章。我刚刚继续前进,但这个问题又重新引起了人们的注意。

Pab*_*bel -1

尝试通过代码加载lottie fileName。当我通过 xml 加载文件时遇到一些问题

您可以将一个 Linear 用于其他视图并调用 Linearlayout.bringToFront()