鸿蒙 HarmonyOS ArkTS ArkUI 动画 向右滑动、向左滑动、向下滑动

    @Entry
    @Component
    struct Index {
      @State Ax: number = 0
      @State Axx: number= 260
      @State Ay: number = 290
      onPageShow():void{
        animateTo ( {
          duration: 2000,
          iterations: -1,
          curve:Curve.Linear,
          playMode:PlayMode.Alternate
        }, () => {
          this.Ax = 260
          this.Axx = 0
          this.Ay = 600
        } )
      }
      build() {
          Column() {

            // 向右滑动
            Column(){}
            .width(100)
            .height(100)
            .backgroundColor('#ffc44f4f')
            .position({x:this.Ax,y:0})
            Text('向右滑动')
              .fontSize(20)
              .fontWeight(FontWeight.Bold)
              .margin({bottom:10,top:110})


            // 向左滑动
            Column(){}
            .width(100)
            .height(100)
            .backgroundColor('#ffc44f4f')
            .position({x:this.Axx,y:150})
            Text('向左滑动')
              .fontSize(20)
              .fontWeight(FontWeight.Bold)
              .margin({bottom:10,top:110})


            // 向下滑动
            Column(){}
            .width(100)
            .height(100)
            .backgroundColor('#ffc44f4f')
            .position({x:130,y:this.Ay})
            Text('向下滑动')
              .fontSize(20)
              .fontWeight(FontWeight.Bold)
              .margin({bottom:10,top:110})
          }
          .width('100%')
          .margin({top:40})


      }
    }

亲爱的读者:

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

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

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

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

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

再次感谢您的阅读和支持!

最诚挚的问候, “特创码农

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-21 16:28:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-21 16:28:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-21 16:28:03       82 阅读
  4. Python语言-面向对象

    2024-01-21 16:28:03       91 阅读

热门阅读

  1. Vue待办事项(组件,模块化)

    2024-01-21 16:28:03       45 阅读
  2. python生成列表坑

    2024-01-21 16:28:03       62 阅读
  3. react mac 安装

    2024-01-21 16:28:03       51 阅读
  4. chatgpt和文心一言哪个更好用?更智能?

    2024-01-21 16:28:03       60 阅读
  5. 三、05-ansible安装

    2024-01-21 16:28:03       59 阅读
  6. Ansible

    2024-01-21 16:28:03       43 阅读
  7. go里面几个并发案例

    2024-01-21 16:28:03       59 阅读
  8. 如何处理html5新标签的浏览器兼容问题?

    2024-01-21 16:28:03       54 阅读
  9. 7-11 尾数a*b

    2024-01-21 16:28:03       60 阅读