如何获取屏幕顶部状态栏、底部导航栏和导航条的高度
========================

可以使用window的[getWindowAvoidArea](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-arkui-uiextension#getwindowavoidarea)方法获取，示例代码如下：

import { window } from '@kit.ArkUI';
import { BusinessError } from '@kit.BasicServicesKit';

@Entry
@Component
struct GetAvoidAreaHeight {
  context = this.getUIContext();

  build() {
    Column() {
      Button('GetAvoidAreaHeight')
        .onClick(() => {
          let systemAvoidAreaType = window.AvoidAreaType.TYPE\_SYSTEM; _// system_
          let navigationIndicatorType = window.AvoidAreaType.TYPE\_NAVIGATION\_INDICATOR; _// navigation_
          if (this.context) {
            window.getLastWindow(this.context.getHostContext()).then((data) => {
          _    // Get the system default area, usually including the status bar and navigation bar_
              let avoidArea1 = data.getWindowAvoidArea(systemAvoidAreaType);
          _    // Top status bar height_
              let statusBarHeight = avoidArea1.topRect.height;
            _  // Bottom navigation bar height_
              let bottomNavHeight = avoidArea1.bottomRect.height;
              _// Get the navigation bar area_
              let avoidArea2 = data.getWindowAvoidArea(navigationIndicatorType);
          _    // Get the height of the navigation bar area_
              let indicatorHeight = avoidArea2.bottomRect.height;
              console.info(\`statusBarHeight is ${statusBarHeight}\`);
              console.info(\`bottomNavHeight is ${bottomNavHeight}\`);
              console.info(\`indicatorHeight is ${indicatorHeight}\`);
            }).catch((err: BusinessError) => {
              console.error(\`Failed to obtain the window. Cause: ${JSON.stringify(err)}\`);
            });
          }
        })
    }
  }
}