#星计划# 鸿蒙 HarmonyOS ArkTS ArkUI 动画 中心旋转、空翻、旋转缩放 原创

特创码农
发布于 2024-1-21 15:40
6080浏览
0收藏

#星计划# 鸿蒙 HarmonyOS ArkTS ArkUI 动画 中心旋转、空翻、旋转缩放-鸿蒙开发者社区

    @Entry
    @Component
    struct Index {
      @State widthA: number = 200
      @State heightA: number= 200
      @State angleA:number = 0
      onPageShow():void{
        animateTo ( {
          duration: 2000,
          iterations: -1,
          curve:Curve.Linear
        }, () => {
          this.widthA = 0
          this.heightA = 0
          this.angleA = 360
        } )
      }
      build() {
          Column() {

            // 中心旋转
            Column(){}
            .width(200)
            .height(200)
            .backgroundColor('#ffc44f4f')
            .rotate({
              x: 0,
              y: 0,
              z: 1,
              angle: this.angleA,
              centerX:100,
              centerY:100,
            })
            Text('中心旋转')
              .fontSize(20)
              .fontWeight(FontWeight.Bold)
              .margin({bottom:10,top:10})



            // 空翻
            Column(){}
            .width(200)
            .height(200)
            .backgroundColor('#ffc44f4f')

            .rotate({
              x: 1,
              y: 0,
              z: 0,
              angle: this.angleA,
              centerX:100,
              centerY:0,
            })
            Text('空翻')
              .fontSize(20)
              .fontWeight(FontWeight.Bold)
              .margin({bottom:10,top:10})

            // 旋转缩放
            Column(){}
            .width(this.widthA)
            .height(this.heightA)
            .backgroundColor('#ffc44f4f')
            .rotate({
              x: 0,
              y: 0,
              z: 1,
              angle: this.angleA,
              centerX:100,
              centerY:100,
            })
            Text('旋转缩放')
              .fontSize(20)
              .fontWeight(FontWeight.Bold)
              .margin({bottom:10,top:10})
          }
          .width('100%')
          .margin({top:40})


      }
    }



  • 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.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.

亲爱的读者:

首先,我要感谢您抽出宝贵的时间阅读这篇文章。我深知,您的每一分每一秒都是宝贵的。为此,我在创作这篇文章时付出了巨大的努力,力求为您提供最具价值的内容。

这篇文章汇聚了我多年的经验与心得,我深信,其中的信息将对您的生活或工作有所启发。如果您觉得这篇文章对您有所裨益,那么,我诚邀您给予一定的赞赏。这份微薄的费用,对您来说可能只是举手之劳,但对我而言,却是极大的鼓励和支持。

我始终坚信,知识的分享是一种力量。因此,我笔耕不辍,希望通过文字与您共同成长。您的每一次支持,都是对我最大的鼓舞,也激发了我创作更多优质内容的热情。

如果您愿意为我加油打气,诚邀您给予一定的赞赏。同时,您的反馈和建议对我而言意义非凡,期待与您在评论区交流心得。

再次感谢您的阅读与支持!愿您一切安好,技术超标。

#星计划# 鸿蒙 HarmonyOS ArkTS ArkUI 动画 中心旋转、空翻、旋转缩放-鸿蒙开发者社区

再次感谢您的阅读和支持!
最诚挚的问候, “特创码农

©著作权归作者所有,如需转载,请注明出处,否则将追究法律责任
收藏
回复
举报


回复
    相关推荐