操作步骤如下:
1. 页面为横屏(通过<page-meta page-orientation="landscape">设置的)。
2. 在onLoad中设置成竖屏
3.onResize函数监听中调用wx.getSystemInfoSync(),有概率获取到的safeArea的top为0
下面为输出日志:
{"screenWidth": 367, "cpuType": "SM8550", "phoneCalendarAuthorized": true, "windowHeight": 814, "bluetoothEnabled": true, "bluetoothAuthorized": false, "language": "zh_CN", "microphoneAuthorized": true, "fontSizeScaleFactor": 1, "locationAuthorized": true, "notificationAuthorized": true, "model": "MAG-AN00", "statusBarHeight": 34, "safeArea": {"width": 367, "right": 367, "top": 0, "left": 0, "bottom": 814, "height": 814}, "brand": "HONOR", "windowWidth": 367, "locationEnabled": false, "benchmarkLevel": 31, "screenHeight": 814, "abi": "arm64-v8a", "version": "8.0.56", "cameraAuthorized": true, "deviceAbi": "arm64-v8a", "system": "Android 13", "memorySize": 15299, "fontSizeSetting": 16, "pixelRatio": 3.275, "deviceOrientation": "portrait", "wifiEnabled": true, "screenTop": 0, "platform": "android", "SDKVersion": "3.7.12", "enableDebug": true, "devicePixelRatio": 3.275, "host": {"env": "WeChat", "version": 671103070}, "mode": "default"}