HarmonyOS 如何禁止深色模式使用?

项目中使用AlertDialog显示提示弹窗,当打开深色模式,弹窗内容会变黑色。

请问如何让弹窗内容显示为白色?设置了背景色不起作用。

AlertDialog.show({
  message: '测试弹窗',
  autoCancel: true,
  cornerRadius:4,
  gridCount: 4,
  backgroundColor: Color.White,
  alignment: DialogAlignment.Center,
  primaryButton: {
    value: '取消',
    action: () => {

    }
  },
  secondaryButton: {
    value: '确定',
    action: () => {

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