HarmonyOS 自定义弹窗点击跳转问题

在PageA中点击按钮显示【自定义弹窗】,在【自定义弹窗】中点击按钮(不关闭弹窗)打开PageB,如何让PageB在弹窗上层(PageB完全覆盖弹窗)而不是下层展示?

HarmonyOS
2024-12-26 16:17:34
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
zbw_apple

参考:

Column() {
  GridRow({
    columns: { xs: 1, sm: 4, md: 8, lg: 12 },
    breakpoints: { value: ["400vp", "600vp", "800vp"],
      reference: BreakpointsReference.WindowSize },
  }) {
    GridCol({
      span: { xs: 1, sm: 2, md: 4, lg: 8 },
      offset: { xs: 0, sm: 1, md: 2, lg: 2 }
    }) {
      Column() {
        Text('跳转吗').fontSize(16).margin({ bottom: 10 })
        Flex({ justifyContent: FlexAlign.SpaceAround }) {
          Button('取消')
            .onClick(() => {
              if (this.visible == Visibility.Visible) {
                this.visible = Visibility.None
              } else {
                this.visible = Visibility.Visible
              }

            }).backgroundColor(0xffffff).fontColor(Color.Black)
          Button('确定')
            .onClick(() => {
              this.pageInfos.pushPath({ name: 'pageOne' })
            }).backgroundColor(0xffffff).fontColor(Color.Red)
        }.margin({ bottom: 10 })
      }
      .backgroundColor(0xffffff)
      .visibility(this.visible)
      .clip(true)
      .borderRadius(20)
    }
  }
}.width('100%') //设置弹窗宽度
}
}.width('100%').margin({ top: 5 })
}.navDestination(this.PageMap)
}
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
分享
微博
QQ
微信
回复
2024-12-26 17:31:35
相关问题
HarmonyOS 自定义弹窗层级问题
1020浏览 • 1回复 待解决
HarmonyOS 自定义弹窗关闭问题
953浏览 • 1回复 待解决
HarmonyOS 自定义弹窗CustomDialog 问题
828浏览 • 1回复 待解决
HarmonyOS 自定义弹窗控制问题
1006浏览 • 1回复 待解决
HarmonyOS 自定义弹窗CustomDialog问题
1384浏览 • 1回复 待解决
HarmonyOS 自定义弹窗问题
1659浏览 • 1回复 待解决
HarmonyOS 自定义弹窗 (CustomDialog)问题
1325浏览 • 1回复 待解决
HarmonyOS 自定义弹窗封装问题
909浏览 • 1回复 待解决
HarmonyOS 自定义CustomDialog 跳转问题
788浏览 • 1回复 待解决
自定义弹窗使用相关问题
1772浏览 • 1回复 待解决
HarmonyOS 自定义弹窗刷新问题
714浏览 • 1回复 待解决
HarmonyOS 自定义弹窗CustomDialog调用问题
1168浏览 • 1回复 待解决
HarmonyOS 自定义弹窗部分问题答疑
1264浏览 • 1回复 待解决
HarmonyOS 自定义弹窗不能显示问题
919浏览 • 1回复 待解决
自定义弹窗自定义转场动画
1995浏览 • 1回复 待解决