android - Android 彩票动画滞后
问题描述
我正在为 iOS 和 Android 开发一个应用程序。启动画面有一个 JSON 动画。在 iOS 中,动画效果很好,但在 Android 中,相同的动画运行时有延迟。有人经历过吗?
注意:动画没有任何图像资源。
我收到了一些错误日志,但它们似乎不相关,因为我已经尝试过其他运行没有滞后的动画并且它显示相同的错误。
这些是错误:
W/LOTTIE: Lottie doesn't support layer effects. If you are using them for fills, strokes, trim paths etc. then try adding them directly as contents in your shape.
Found: [Radial Shadow]
W/LOTTIE: Animation contains merge paths. Merge paths are only supported on KitKat+ and must be manually enabled by calling enableMergePathsForKitKatAndAbove().
解决方案
正如您的警告消息所述,请尝试设置enableMergePathsForKitKatAndAbove()
.
例如,在 xml -
<com.airbnb.lottie.LottieAnimationView
...
...
...
app:lottie_enableMergePathsForKitKatAndAbove="true"/>
或者,在 Java 中 -
lottieAnimationView.enableMergePathsForKitKatAndAbove(true);
推荐阅读
- php - Laravel 验证规则需要两个字段中的任何一个,但两者都不应该存在
- pine-script - 止损和目标的单独出口
- python - 宽度减小后如何在 JupyterLab 中将单元格居中?
- flutter - 未来
函数返回空值颤动 - javascript - 从 ajax 加载时,锚标记助手呈现为纯文本
- python - 根据 pyspark 或 koalas 中的正则表达式匹配拆分字符串列
- python - django 使用 2 个不同的数据库
- angular - 如何在 fusiontime 图表中显示 7 天的分箱?
- linux - 用于根据扩展名将文件分类到子文件夹的 Bash 脚本
- outlook - 兑换独立 MAPI 连接到 Outlook 365 / O365