世博会上的Lottie动画 [英] Lottie animation on Expo

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

问题描述

我在我的本地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文件放在同一文件夹中.我猜Lottie找不到图像.我为"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

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

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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆