yuzhilin
... ... @@ -11,13 +11,14 @@ struct ENewspaper {
// 获取UIAbility上下文
context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext
async setSystemBar(color: string, barColor: string) {
async setSystemBar(color: string, barColor: string, barContentColor: string) {
// 获取当前应用窗口
let windowClass: window.Window = await window.getLastWindow(this.context)
// 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色
await windowClass.setWindowSystemBarProperties({
navigationBarColor: color,
statusBarColor: barColor,
statusBarContentColor: barContentColor,
})
}
... ... @@ -45,12 +46,12 @@ struct ENewspaper {
}
onPageShow() {
this.setSystemBar('#80000000','#80000000')
this.setSystemBar('#80000000','#80000000', '#FFFFFFFF')
Logger.info(TAG, 'onPageShow');
}
onPageHide() {
this.setSystemBar('#FFFFFFFF','#00000000')
this.setSystemBar('#FFFFFFFF','#00000000', '#000000')
Logger.info(TAG, 'onPageHide');
}
... ...