世博会的洛蒂动画

世博会的洛蒂动画

本文介绍了世博会的洛蒂动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 react native Expo 应用程序中使用了这个动画:https://www.lottiefiles.com/86-bouncy-dribbble-ball

I'm using this animation in my react native Expo app:https://www.lottiefiles.com/86-bouncy-dribbble-ball

动画运行,我可以看到球的影子但看不到球的图像.

The animation runs, I can see the shadow of the ball but I can't see the ball image.

图片在动画json文件中是这样定义的:

The image is defined like this in the animation json file:

[{"id":"image_0","w":289,"h":287,"u":"images/","p":"img_0.png"}]

我把图片和json文件放到同一个文件夹里.我猜洛蒂找不到图像.我为 "u" 参数尝试了很多不同的组合,但我无法显示图像.

I put the image and the json file into the same folder. I guess Lottie can't find the image. I tried lots of different combinations for the "u" parameter but I couldn't manage to show the image.

感谢任何帮助.

推荐答案

https://github.com/airbnb/lottie-react-native/issues/145

我找到了解决方案 - 只需将图像文件夹拖到 Xcode 项目中的捆绑资源中即可.

I found the solution - just drag the images folder into your bundle resources in your Xcode project.

这篇关于世博会的洛蒂动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 21:23