let windowClass = AppStorage.get("mainWindow") as window.Window
// 1. 设置窗口全屏
windowClass.setWindowLayoutFullScreen(true)
.then(() => {
hilog.info(0x0000,'test','Succeeded in setting the window layout to full-screen mode.');
})
.catch((err: BusinessError) => {
hilog.error(0x0000,'test','Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err));
});
1.
2.
3.
4.
5.
6.
7.
8.
9.
关闭窗口全屏
let windowClass = AppStorage.get("mainWindow") as window.Window
// 1. 关闭窗口全屏
windowClass.setWindowLayoutFullScreen(false)
.then(() => {
hilog.info(0x0000,'test','Succeeded in setting the window layout to full-screen mode.');
})
.catch((err: BusinessError) => {
hilog.error(0x0000,'test','Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err));
});