From 10ec8bef1712f0448f7181f96542c4f02ddb2895 Mon Sep 17 00:00:00 2001 From: dhf_fanr <1511447814@qq.com> Date: Wed, 3 Sep 2025 13:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=8B=93=E5=B1=95=E5=8C=BA?= =?UTF-8?q?=E9=81=BF=E8=AE=A9readme=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ExpandSafeArea/README_zh.md | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ExpandSafeArea/README_zh.md diff --git a/ExpandSafeArea/README_zh.md b/ExpandSafeArea/README_zh.md new file mode 100644 index 00000000..fe5e201f --- /dev/null +++ b/ExpandSafeArea/README_zh.md @@ -0,0 +1,41 @@ +# 基于expandSafeArea实现自动避让挖孔区 + +### 介绍 + +本示例是[《窗口沉浸式》](https://developer.huawei.com/consumer/cn/doc/best-practices/bpta-multi-device-window-immersive)的配套示例代码,通过父子组件使用expandSafeArea属性,来动态实现避让挖孔区。 + +### 使用说明 + +1. 启动应用,首页为沉浸式效果,背景色可透过系统栏区域。 +2. 设备旋转后,子组件部分会自动避让系统挖孔区。 + +### 工程目录 +``` +├──entry/src/main/ets // 代码区 +│ ├──entryability +│ │ └──EntryAbility.ets // 程序入口类 +│ ├──entrybackupability +│ │ └──EntryBackupAbility.ets +│ └──pages +│ └──Index.ets // 首页 +└──entry/src/main/resources // 应用资源目录 +``` +### 具体实现 + +* 该示例使用为父组件添加expandSafeArea属性,使父组件拓展系统栏区域,实现父组件背景色可透过系统栏区域。 +* 为子组件添加expandSafeArea属性,参数为[],表示子组件将不拓展任何系统栏区域,从而达到无论屏幕如何旋转,子组件都会自动避让挖孔区。 + +### 相关权限 + +不涉及。 + +### 依赖 + +不涉及。 + +### 约束与限制 + +1. 本示例仅支持标准系统上运行,支持设备:华为手机、平板。 +2. HarmonyOS系统:HarmonyOS 5.1.1 Release及以上。 +3. DevEco Studio版本:DevEco Studio 5.1.1 Release及以上。 +4. HarmonyOS SDK版本:HarmonyOS 5.1.1 Release SDK及以上。 \ No newline at end of file -- Gitee