我在react原生中使用一个Imagebackground组件,它是一个卡片组件,有一些图像要设置在背景上,不,我必须使用Lottie设计,所以我无法获得如何在ImageBackground中使用lottie设计。如果选择了lottie设计,那么我将展示lottie设计,否则将显示Imagebackground数据。
<ImageBackground>
<LottieView
source={require('../path/to/animation.json')}
colorFilters={[{
keypath: "button",
color: "#F00000"
},{
keypath: "Sending Loader",
color: "#F00000"
}]}
autoPlay
loop
></LottieView>
</ImageBackground>如何在图像背景中使用lottie设计。
发布于 2021-02-15 21:50:30
尝试一下,在视图中添加绝对位置的Lottie动画,并使用zIndex将其设置为背景视图。
看看Github的问题,这可能会对你有帮助。
https://github.com/lottie-react-native/lottie-react-native/issues/307
https://stackoverflow.com/questions/66209176
复制相似问题