项目中使用AlertDialog显示提示弹窗,当打开深色模式,弹窗内容会变黑色。
请问如何让弹窗内容显示为白色?设置了背景色不起作用。
AlertDialog.show({
message: '测试弹窗',
autoCancel: true,
cornerRadius:4,
gridCount: 4,
backgroundColor: Color.White,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
}
},
secondaryButton: {
value: '确定',
action: () => {
}
}
})
不跟随系统可以使用setColorMode,参考https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-inner-application-applicationcontext-V5\#applicationcontextsetcolormode11