FA模型,在app.ets的Oncreate内添加:

var windowClass = null;
            let promise = window.getTopWindow();
promise.then((data)=> {
            windowClass = data;
            console.info('Succeeded in obtaining the top window. Data: ' + JSON.stringify(data))
        }).then(()=>{
            windowClass.setFullScreen(true)
            this.windowFull=true
            console.info('Succeeded in obtaining the top window. Data: ')
        })

import文件:

import window from '@ohos.window';

 

 

 

 

如下图:

 

 

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐