diff --git a/ImageEditTaskPool/entry/src/main/ets/entryability/EntryAbility.ets b/ImageEditTaskPool/entry/src/main/ets/entryability/EntryAbility.ets index a45e4df3aec690dab77039368e800288064e58fa..75e3ec3417c7366f020f22b4db8a17b3d200d8ec 100644 --- a/ImageEditTaskPool/entry/src/main/ets/entryability/EntryAbility.ets +++ b/ImageEditTaskPool/entry/src/main/ets/entryability/EntryAbility.ets @@ -62,11 +62,12 @@ export default class EntryAbility extends UIAbility { `Failed to set the system bar properties. Cause code: ${err.code}, message: ${err.message}`); }); + const uiContext = windowClass.getUIContext(); let navigationBarArea: window.AvoidArea = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR); let area: window.AvoidArea = windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM); - AppStorage.setOrCreate('naviIndicatorHeight', this.getUIContext().px2vp(navigationBarArea.bottomRect.height)); - AppStorage.setOrCreate('statusBarHeight', this.getUIContext().px2vp(area.topRect.height)); + AppStorage.setOrCreate('naviIndicatorHeight', uiContext.px2vp(navigationBarArea.bottomRect.height)); + AppStorage.setOrCreate('statusBarHeight', uiContext.px2vp(area.topRect.height)); windowStage.loadContent('pages/HomePage', (err, data) => { if (err.code) {