let sysBarProps: window.SystemBarProperties = {
statusBarColor: '#ff00ff',
};
let windowClass: window.Window = this.windowStage.getMainWindowSync(); // 获取应用主窗口
windowClass.setWindowSystemBarProperties(sysBarProps, (err: BusinessError) => {
let errCode: number = err.code;
if (errCode) {
console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(err));
return;
}
console.info('Succeeded in setting the system bar properties.');
});
}
参考demo: