HarmonyOS popup设置背景色(设置不生效)?

相关代码设置:

.bindPopup(this.customPopup, {
  builder: this.popupBuilder, // 气泡的内容
  placement:Placement.Top, // 气泡的弹出位置
  popupColor:Color.Black, // 气泡的背景色
  onStateChange: (e) => {
    console.info(JSON.stringify(e.isVisible))
    if (!e.isVisible) {
      this.customPopup = false
    }
  }
})

// 自定义气泡弹窗构造器
@Builder popupBuilder() {
  Row({ space: 3 }) {

  }.width(200).height(50).padding(5)
  .backgroundColor(Color.Black)
}
阅读 413
1 个回答

当前气泡中新增了backgroundBlurStyle属性,默认值为BlurStyle.COMPONENT\_ULTRA\_THICK,这个值和设置气泡颜色冲突,需要在ets中将该属性设置为BlurStyle.NONE

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进