HarmonyOS Lottie文件能显示,但不会做动画

build() {
  Column() {
    /// GuaguaLoading
    Canvas(this.renderingContext)
      .width(Zoom(144))
      .height(Zoom(144))
      .onReady(() => {
        console.log("GuaLessonLoadingProgress lottie loadAnimation");
        lottie.loadAnimation({
          container: this.renderingContext,
          renderer: 'canvas',
          loop: true,
          autoplay: true,
          name: this.animateName,
          path: this.animatePath,
        });
      })
      .onDisAppear(() => {
        console.log("GuaLessonLoadingProgress lottie destroy");
        lottie.destroy(this.animateName);
      })
  }
  .width('100%')
  .height('100%')
  .backgroundColor(Color.White)
  .justifyContent(FlexAlign.Center)
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
HarmonyOS
2024-12-11 15:58:19
777浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
fox280

动画这边文件应该是自己生成的json文件,加载,播放暂停等参考下这个文档:https://gitee.com/openharmony-tpc/lottieArkTS

分享
微博
QQ
微信
回复
2024-12-11 17:03:48


相关问题
HarmonyOS lottie动画
854浏览 • 1回复 待解决
HarmonyOS 如何加载lottie动画
880浏览 • 1回复 待解决
HarmonyOS 怎样加载Lottie动画
808浏览 • 1回复 待解决
HarmonyOS 本地lottie动画无法播放
1457浏览 • 1回复 待解决
HarmonyOS Lottie动画加载不出来
890浏览 • 1回复 待解决
动画lottie能否设置播放次数
2723浏览 • 1回复 待解决
HarmonyOS Lottie动画有加载的指导吗
707浏览 • 1回复 待解决
HarmonyOS lottie显示图片不成功
739浏览 • 1回复 待解决
lottie动画组件存在严重的内存泄漏
2546浏览 • 1回复 待解决
Refresh结合lottie实现下拉刷新动画
1952浏览 • 1回复 待解决