#鸿蒙通关秘籍# 如何利用鸿蒙HarmonyOS NEXT的Grid组件实现网格元素的拖拽动画效果?

HarmonyOS
2024-12-11 11:06:37
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
一路向北545
 .onItemDragStart((event: ItemDragInfo, itemIndex: number) => { //第一次拖拽此事件绑定的组件时,触发回调。
        return this.pixelMapBuilder(this.data[itemIndex]); //设置拖拽过程中显示的图片。
      })
      .onItemDrop((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => {
        if (!isSuccess || insertIndex >= this.data.length) {
          return
        }
        this.changeIndex(itemIndex, insertIndex)
      })
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.


​https://ost.51cto.com/posts/31032​

分享
微博
QQ
微信
回复
2024-12-14 20:51:12
相关问题
HarmonyOS grid拖拽效果如何添加动画
699浏览 • 1回复 待解决
HarmonyOS grid拖拽和增删动画效果
624浏览 • 1回复 待解决