![](https://s5-media.51cto.com/ost/pc/static/noavatar.gif)
回复
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)
代码地址:
https://gitee.com/jltfcloudcn/jump_to/tree/master/JLTF_TapGesture