Showing
1 changed file
with
4 additions
and
3 deletions
| @@ -11,13 +11,14 @@ struct ENewspaper { | @@ -11,13 +11,14 @@ struct ENewspaper { | ||
| 11 | // 获取UIAbility上下文 | 11 | // 获取UIAbility上下文 |
| 12 | context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext | 12 | context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext |
| 13 | 13 | ||
| 14 | - async setSystemBar(color: string, barColor: string) { | 14 | + async setSystemBar(color: string, barColor: string, barContentColor: string) { |
| 15 | // 获取当前应用窗口 | 15 | // 获取当前应用窗口 |
| 16 | let windowClass: window.Window = await window.getLastWindow(this.context) | 16 | let windowClass: window.Window = await window.getLastWindow(this.context) |
| 17 | // 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色 | 17 | // 将状态栏和导航栏的背景色设置为跟应用窗口相同的颜色 |
| 18 | await windowClass.setWindowSystemBarProperties({ | 18 | await windowClass.setWindowSystemBarProperties({ |
| 19 | navigationBarColor: color, | 19 | navigationBarColor: color, |
| 20 | statusBarColor: barColor, | 20 | statusBarColor: barColor, |
| 21 | + statusBarContentColor: barContentColor, | ||
| 21 | }) | 22 | }) |
| 22 | } | 23 | } |
| 23 | 24 | ||
| @@ -45,12 +46,12 @@ struct ENewspaper { | @@ -45,12 +46,12 @@ struct ENewspaper { | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | onPageShow() { | 48 | onPageShow() { |
| 48 | - this.setSystemBar('#80000000','#80000000') | 49 | + this.setSystemBar('#80000000','#80000000', '#FFFFFFFF') |
| 49 | Logger.info(TAG, 'onPageShow'); | 50 | Logger.info(TAG, 'onPageShow'); |
| 50 | } | 51 | } |
| 51 | 52 | ||
| 52 | onPageHide() { | 53 | onPageHide() { |
| 53 | - this.setSystemBar('#FFFFFFFF','#00000000') | 54 | + this.setSystemBar('#FFFFFFFF','#00000000', '#000000') |
| 54 | Logger.info(TAG, 'onPageHide'); | 55 | Logger.info(TAG, 'onPageHide'); |
| 55 | } | 56 | } |
| 56 | 57 |
-
Please register or login to post a comment