2017-10-11 81 views
0

我目前正在玩Android版AirBnB的Lottie library,我遇到LottieAnimationView Z订购问题。不管我是否放置LottieAnimationView在RelativeLayout的顶部,它总是出现在所有布局前的其他元素的顶部:Lottie动画库Z订购问题

<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> 

我也尝试设置LottieAnimationView的海拔为0 ,但在解决问题方面没有成功。有没有人有如何解决这个问题的想法,或者如果它只是图书馆的限制?另外,如果是限制,是什么原因造成的?

回答

0

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

您可以为其他视图使用一个Linear并调用linearlayout.bringToFront()