首页遮罩参考demo:@Entry @Component struct Index { @State isMask: boolean = false build() { Stack() { Button('功能描述') .fontSize(16) if (this.isMask) { // 遮罩 Row() { Button('收藏') Button('相似') Button('删除') } .backgroundColor("#50000000") .height('100%') .width('100%') .borderRadius(10) .justifyContent(FlexAlign.SpaceAround) } } .height(100) .width('100%') .borderRadius(10) .backgroundColor(0xFFFFFF) .gesture(LongPressGesture({ fingers: 1, repeat: false }).onAction(() => { this.isMask = true }).onActionEnd(() => { })) } }
首页遮罩参考demo: