HarmonyOS里面有类似Rotate3dAnimation的东西吗

需要把一张图片通过翻转制作成3D的动态效果

HarmonyOS
2024-12-26 15:25:12
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
FengTianYa

参考:

@State rotateValue: number = 0;
Image($r('app.media.startIcon')).width(200).height(200).margin({ top: 100 })
  .rotate({ x: 0, y: 1, z: 0, angle: this.rotateValue })
  .onClick(()=>{
    setInterval(()=>{
      if (this.rotateValue < 360) {
        this.rotateValue++;
      }else {
        this.rotateValue = 0;
      }
    }, 1000)
  })
Image($r('app.media.startIcon')).width(200).height(200).margin({ top: 100 })
  .rotate({ x: 1, y: 0, z: 0, angle: this.rotateValue })
  .onClick(()=>{
    setInterval(()=>{
      if (this.rotateValue < 360) {
        this.rotateValue ++;
      }else {
        this.rotateValue = 0;
      }
    }, 10)
  })
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
分享
微博
QQ
微信
回复
2024-12-26 18:29:44
相关问题
鸿蒙里面有alpha动画
7465浏览 • 1回复 已解决
HarmonyOS NDK里面有无内置网络库
806浏览 • 1回复 待解决
HarmonyOS PixelMap.rotate接口导致闪退
776浏览 • 1回复 待解决
HarmonyOS有没类似Android里面的Fragment
15225浏览 • 4回复 待解决
HarmonyOS类似bugly开发包
873浏览 • 1回复 待解决
HarmonyOS ArkTS有类似bigdecimal方法
1188浏览 • 1回复 待解决
HarmonyOS类似骨架屏实现demo
835浏览 • 1回复 待解决