app蒙版?

app首页有一个引导蒙版的功能,想咨询一下使用什么方式做用户引导蒙版比较好,可以满足不同机型的适配

阅读 542
1 个回答

首页遮罩参考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(() => { 
 
    })) 
  } 
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进