实现前的效果:
实现后的效果:
关键部分
1.要设置状态栏全面屏的效果
2.给状态栏设置对应的颜色
具体实现代码:
setLayoutFullScreen(windowStage: window.WindowStage) {
let windowClass = null
windowStage.getMainWindow((error, data) => {
if (error.code) {
console.error('failed to obtain main window,cause:' + JSON.stringify(error))
return
}
windowClass = data
console.error('Succeeded to obtain main window,data:' + JSON.stringify(data))
let names = ["status"]
windowClass.setWindowSystemBarEnable(names, (error) => {
if (error.code) {
console.error('Failed to set the system bar to be visible. Cause:' + JSON.stringify(