private controller = new CustomDialogController({
builder: CustomDialogView({
visible: $visible,
onCancel: this.onCancel,
onConfirm: this.onConfirm,
}),
alignment:DialogAlignment.Center,
autoCancel: false,
backgroundColor:'#00000000'
})
原来设置了backgroundColor基本上 弹窗颜色就跟遮罩层差不多, 后面手机更新后发现,原来的白色背景又出现了
需要采用自定义样式来消除自定义弹窗的白色背景:
1、在初始化自定义弹窗时设置customStyle为true。
2、在定义弹窗时设置组件背景色backgroundColor为透明色。
参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-methods-custom-dialog-box-V5