使用window.setWindowSystemBarProperties()接口即可设置。示例代码Text(this.message) .fontSize(50) .fontWeight(FontWeight.Bold) .onClick(()=>{ window.getLastWindow(getContext(this),(err,win)=>{ // TYPE_CUTOUT表示刘海屏区域。 let cutOutInfo=win.getWindowAvoidArea(window.AvoidAreaType.TYPE_CUTOUT); console.log(JSON.stringify(cutOutInfo)); // TYPE_SYSTEM 表示系统默认区域。一般包括状态栏、导航栏,各设备系统定义可能不同。 let systemArea = win.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); console.log(JSON.stringify(systemArea)); // 设置导航栏状态栏颜色 win.setWindowSystemBarProperties({ // 状态栏颜色 statusBarColor:'#66666666', // 状态栏文字颜色 statusBarContentColor:'#ffffffff', // 导航栏颜色 navigationBarColor:'#ff000000', // 导航栏文字颜色 navigationBarContentColor:'#ffffffff' }) }) })
使用window.setWindowSystemBarProperties()接口即可设置。
示例代码