HarmonyOS应用开发ets基础手势TapGesture

鸿蒙时代
发布于 2022-1-8 12:13
浏览
0收藏

HarmonyOS应用开发ets基础手势TapGesture-开源基础软件社区
HarmonyOS应用开发ets基础手势TapGesture-开源基础软件社区
3.代码示例

@Entry
@Component
struct Index {
  @State value: string = ''

  build() {
    Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.SpaceBetween }) {
      Text('连续点击两次')
        .fontSize(20)
      Text(this.value)
        .fontSize(20)
    }
    .height(200).width(300).padding(60).border({ width: 1 }).margin(30)
    .gesture(
    TapGesture({ count: 2 })
      .onAction(() => {
        this.value = 'this TapGesture onAction'
      })
    )
  }
}

4.效果
(A)->(B)
HarmonyOS应用开发ets基础手势TapGesture-开源基础软件社区
代码地址:
https://gitee.com/jltfcloudcn/jump_to/tree/master/JLTF_TapGesture

标签
HarmonyOS应用开发ets基础手势TapGesture.docx 32.65K 16次下载
1
收藏
回复
举报
回复
添加资源
添加资源将有机会获得更多曝光,你也可以直接关联已上传资源 去关联
    相关推荐