| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| AppScope/ | 06-May-2025 | - | 35 | 32 | ||
| entry/ | 06-May-2025 | - | 1,049 | 910 | ||
| entry2/ | 06-May-2025 | - | 578 | 506 | ||
| hvigor/ | 06-May-2025 | - | 38 | 36 | ||
| screenshots/ | 06-May-2025 | - | ||||
| .gitignore | D | 06-May-2025 | 133 | 12 | 12 | |
| README.md | D | 06-May-2025 | 4.7 KiB | 147 | 96 | |
| build-profile.json5 | D | 06-May-2025 | 1.5 KiB | 64 | 63 | |
| code-linter.json5 | D | 06-May-2025 | 958 | 35 | 34 | |
| hvigorfile.ts | D | 06-May-2025 | 830 | 22 | 5 | |
| oh-package.json5 | D | 06-May-2025 | 834 | 26 | 24 | |
| ohosTest.md | D | 06-May-2025 | 2.6 KiB | 32 | 21 |
README.md
1# entry: 2 3## Web组件嵌套滚动 4 5### 介绍 6 7#### ImpNestedScroll 8 91. 实现对以下指南文档中 https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/web/web-nested-scrolling.md 示例代码片段的工程化,保证指南中示例代码与sample工程文件同源。 10 11##### 效果预览 12 13| 主页 | 14| ---------------------------------------------------------- | 15| <img src="screenshots\ImpNestedScroll.png" width="360;" /> | 16 17##### 使用说明 18 191. 设置滚动模式(前) 20 - 在 切换前滚动模式 区域,点击 SELF_ONLY、SELF_FIRST、PARENT_FIRST、PARALLEL 按钮,可分别将 NestedScrollModeF 设置为相应的滚动模式,此模式用于控制 Web 视图向前滚动(scrollForward)时与父组件的交互方式。 212. 设置滚动模式(后) 22 - 在 切换后滚动模式 区域,同样点击上述按钮,可设置NestedScrollModeB,用于控制 Web 视图向后滚动(scrollBackward)时的交互模式。 23 24## Web组件对接软键盘 25 26### 介绍 27 281. 实现对以下指南文档中 https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/web/web-docking-softkeyboard.md 示例代码片段的工程化,保证指南中示例代码与sample工程文件同源。 29 30#### SetSKBMode_one 31 32##### 介绍 33 341. 本示例主要介绍Web组件对接软键盘,在UIContext的键盘避让模式为Offset模式情况下,通过WebKeyboardAvoidMode()设置ArkWeb组件的键盘避让模式。 35 36##### 效果预览 37 38| 主页 | 软键盘 | 39| ------------------------------------------------------------ | ------------------------------------------------------------ | 40| <img src="./screenshots/SetSKBMode_one_1.png" width="360;" /> | <img src="./screenshots/SetSKBMode_one_2.png" width="360;" /> | 41 42使用说明 43 441. 点击输入框拉起软键盘。 45 46#### OnIntKbdAttachSysCustIn 47 48##### 介绍 49 501. 本示例主要介绍拦截系统软键盘与自定义软键盘输入,调用onInterceptKeyboardAttach来拦截系统软键盘的弹出。 51 52 53##### 效果预览 54 55| 主页 | 56| ------------------------------------------------------------ | 57| <img src="./screenshots/OnIntKbdAttachSysCustIn.png" width="360;" /> | 58 59使用说明 60 611. 点击未设置特殊属性的输入框,将默认使用系统默认键盘。 622. 点击设置了keyboard-return属性的输入框,根据属性值获取对应的enterKeyType,以改变系统键盘回车键的行为。 63 64### 工程目录 65 66``` 67entry/src/main/ 68|---ets 69|---|---entryability 70|---|---|---EntryAbility.ets 71|---|---pages 72|---|---|---Index.ets // 首页 73|---|---|---OnIntKbdAttachSysCustIn.ets 74|---|---|---SetSKBMode_one.ets 75|---|---|---ImpNestedScroll.ets 76|---resources // 静态资源 77|---ohosTest 78|---|---ets 79|---|---|---tests 80|---|---|---|---Ability.test.ets // 自动化测试用例 81``` 82 83 84### 相关权限 85 86[ohos.permission.INTERNET](https://docs.openharmony.cn/pages/v5.0/zh-cn/application-dev/security/AccessToken/permissions-for-all.md#ohospermissioninternet) 87 88## entry2: 89 90### SetSKBMode_two 91 92#### 介绍 93 941. 本示例主要介绍Web组件对接软键盘,设置UIContext的软键盘避让模式setKeyboardAvoidMode(KeyboardAvoidMode.RESIZE),应用窗口高度可缩小避开软键盘,ArkWeb组件跟随ArkUI重新布局。 95 96#### 效果预览 97 98| 主页 | 软键盘 | 99| ----------------------------------------------------------- | ----------------------------------------------------------- | 100| <img src="screenshots\SetSKBMode_two_1.png" width="360;" /> | <img src="screenshots\SetSKBMode_two_2.png" width="360;" /> | 101 102使用说明 103 1041. 点击输入框拉起软键盘。 105 106### 工程目录 107 108``` 109entry2/src/main/ 110|---ets 111|---|---entry2ability 112|---|---|---Entry2Ability.ets 113|---|---pages 114|---|---|---Index.ets // 首页 115|---resources // 静态资源 116|---ohosTest 117|---|---ets 118|---|---|---tests 119|---|---|---|---Ability.test.ets // 自动化测试用例 120``` 121 122 123### 相关权限 124 125无。 126 127## 依赖 128 129不涉及。 130 131## 约束与限制 132 1331. 本示例仅支持标准系统上运行,支持设备:RK3568。 1342. 本示例支持API14版本SDK,SDK版本号(API Version 14 Release)。 1353. 本示例需要使用DevEco Studio 版本号(5.0.1Release)才可编译运行。 136 137## 下载 138 139如需单独下载本工程,执行如下命令: 140 141``` 142git init 143git config core.sparsecheckout true 144echo code/DocsSample/ArkWeb/ManageWebPageInteracts > .git/info/sparse-checkout 145git remote add origin https://gitee.com/openharmony/applications_app_samples.git 146git pull origin master 147```