From 1b7d0b0bba2033aa6d3e06e374b7bd489a580c82 Mon Sep 17 00:00:00 2001 From: xuqm Date: Tue, 25 Mar 2025 16:50:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(basic):=20=E6=B7=BB=E5=8A=A0=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=E5=AE=BD=E9=AB=98=E8=8E=B7=E5=8F=96=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 WindowHelper 中添加获取屏幕宽度和高度的方法- 更新 README.md,添加新方法 --- CHANGELOG.md | 1 + README.md | 6 ++++++ src/main/ets/view/SafeView.ets | 1 + 3 files changed, 8 insertions(+) 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 })