相关代码设置:
.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)
}
当前气泡中新增了backgroundBlurStyle属性,默认值为BlurStyle.COMPONENT\_ULTRA\_THICK,这个值和设置气泡颜色冲突,需要在ets中将该属性设置为BlurStyle.NONE