To set the background dimness of a component like dialog box, in Android we can use the setDimAmount
function.
dialog.getWindow().setDimAmount(0.5);
What is the alternative for this in HarmonyOS?
dialog.show();
Optional<WindowManager.LayoutConfig> configOpt = dialog.getWindow().getLayoutConfig();
configOpt.ifPresent(config -> {
config.dim = 0.0f;
dialog.getWindow().setLayoutConfig(config);
});
Just try to configure the attributes of the corresponding window after dialog.show()
.