HarmonyOS bindPopup怎么获取弹出的message的点击事件

bindPopup怎么获取弹出的message的点击事件,不想自定义,primaryButton文字颜色不能设置,而且不好看,没有系统的弹出好看,所以想加一个点击事件。

HarmonyOS
2024-12-24 17:27:04
722浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
FengTianYa

参考示例demo如下:

@Entry
@Component
struct Index {
  @State showPop:boolean = false
  @Builder
  popBuilder(){
    Column(){
      Text('弹出气泡').fontColor(Color.White)
    }.height(50)
  }
  build() {
    Row() {
      Text('点我弹气泡').onClick(()=>{
        this.showPop = !this.showPop
      }).bindPopup(this.showPop, {
        builder:this.popBuilder(),
        placement:Placement.Top,
        popupColor:'#FF0000',
        backgroundBlurStyle:BlurStyle.NONE,
        mask:false,
        radius:5,
        offset:{x:0, y:5},
        onStateChange:(v)=>{
          if(!v.isVisible){
            this.showPop = false
          }
        }
      })
    }
    .height('100%')
    .width('100%')
  }
}
  • 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.
分享
微博
QQ
微信
回复
2024-12-24 18:31:40


相关问题
HarmonyOS bindPopup使用
825浏览 • 1回复 待解决
HarmonyOS 点击事件回调方法
1039浏览 • 1回复 待解决
如何禁止Button点击事件
1303浏览 • 1回复 待解决
HarmonyOS 是否有监听点击事件API
784浏览 • 1回复 待解决
HarmonyOS 点击事件过滤
655浏览 • 1回复 待解决
通知栏点击事件监听方法
1191浏览 • 1回复 待解决
HarmonyOS 弹层点击事件透传处理
888浏览 • 1回复 待解决