diff --git a/CHANGELOG.md b/CHANGELOG.md index 4050fd2..719178e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ > - `RefreshView`参数不包含`onLoadMore`的时候,上划不应该提示`没有更多数据了` > - `RefreshView`添加一个`controller`,补充跳转到顶部,跳转到底部等方法,具体见文档`4.3`注释 +> - `WindowHelper`添加一个获取屏幕宽高的方法 > # [v1.0.8] 2025.03.11 diff --git a/README.md b/README.md index f1b3342..ea3a8ed 100644 --- a/README.md +++ b/README.md @@ -553,6 +553,12 @@ WindowHelper.topRectHeight() // 底部安全区高度 WindowHelper.bottomRectHeight() + +// 屏幕宽度 +WindowHelper.windowsWidth + +// 屏幕高度 +WindowHelper.windowsHeight ``` # **** 常见问题 diff --git a/src/main/ets/view/SafeView.ets b/src/main/ets/view/SafeView.ets index e566a69..2705c68 100644 --- a/src/main/ets/view/SafeView.ets +++ b/src/main/ets/view/SafeView.ets @@ -60,6 +60,7 @@ export struct SafeView { this.customBuilderParam() } .padding({ + // 沉浸式直接0,如果给值的话,会造成用户ui无法覆盖状态栏 top: this.isImmersive ? 0 : this.hideNavBar ? 44 : WindowHelper.topRectHeight + 44, bottom: this.isImmersive ? 0 : WindowHelper.bottomRectHeight })