| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| AppScope/ | 06-May-2025 | - | 35 | 32 | ||
| entry/ | 06-May-2025 | - | 1,813 | 1,659 | ||
| hvigor/ | 06-May-2025 | - | 8 | 8 | ||
| screenshots/devices/ | 06-May-2025 | - | ||||
| .gitignore | D | 06-May-2025 | 119 | 11 | 11 | |
| README_zh.md | D | 06-May-2025 | 2.8 KiB | 77 | 52 | |
| build-profile.json5 | D | 06-May-2025 | 1.1 KiB | 43 | 42 | |
| hvigorfile.ts | D | 06-May-2025 | 768 | 17 | 1 | |
| hvigorw | D | 06-May-2025 | 2.1 KiB | 62 | 28 | |
| hvigorw.bat | D | 06-May-2025 | 2 KiB | 72 | 56 | |
| oh-package.json5 | D | 06-May-2025 | 846 | 27 | 26 | |
| ohosTest.md | D | 06-May-2025 | 1.6 KiB | 13 | 11 |
README_zh.md
1# 自绘编辑框 2 3### 介绍 4本示例通过输入法框架实现自会编辑框,可以绑定输入法应用,从输入法应用输入内容,显示和隐藏输入法。 5 6### 效果预览 7 8| 主页 | 9| :---------------------------------------: | 10|  | 11 12使用说明 13 141.点击编辑框可以绑定并拉起输入法,可以从输入法键盘输入内容到编辑框。 15 162.可以点击**attach**/**dettach**、**show**/**hide**、**on**/**off**按钮来绑定/解绑、显示/隐藏、开启监听/关闭监听。 17 183.输入光标信息后点击**updateCursor**向输入法应用发送光标信息,发送成功会右toast提示。 19 204.输入选中文本的开始和结束位置,点击**changeSelection**可以选中文本。 21 225.选择文本输入类型和Enter键类型后,点击**updateAttribute**可以更新拉起的输入法的输入类型和Enter键类型,依赖输入法应用是否适配。 23 24### 工程目录 25 26``` 27CustomInputText 28├── AppScope 29│ └── app.json5 //APP信息配置文件 30├── entry/src/main //应用首页 31│ ├── ets 32│ │ ├── entryability 33│ │ ├── components //自定义组件 34│ │ │ ├── CustomInputText.ets //自绘编辑框组件 35│ │ ├── pages 36│ │ │ ├── Index.ets //主页 37│ │ ├── utils 38│ │ │ ├── Logger.ets //日志工具类 39│ │ │ ├── InputAttributeInit.ets //编辑框属性工具类 40│ └── module.json5 41 42``` 43 44### 具体实现 45 46* 自绘编辑框 47 * 使用输入法框架实现组件绑定输入法应用,监听输入法事件,显示和隐藏输入法,发送光标和编辑框属性到输入法应用功能。 48 * 源码链接:[Index.ets](./entry/src/main/ets/pages/Index.ets),[CustomInputText.ets](./entry/src/main/ets/components/CustomInputText.ets) 49 * 参考接口:[@ohos.inputMethod](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-ime-kit/js-apis-inputmethod.md) 50 51### 相关权限 52 53不涉及。 54 55### 依赖 56 57不涉及。 58 59### 约束与限制 60 611.本示例仅支持标准系统上运行。 62 632.本示例支持API10版本SDK,SDK版本号(API Version 10 Release),镜像版本号(4.0Release) 。 64 653.本示例需要使用DevEco Studio 版本号(4.0Release)及以上版本才可编译运行。 66 67### 下载 68 69如需单独下载本工程,执行如下命令: 70 71``` 72git init 73git config core.sparsecheckout true 74echo code/Solutions/InputMethod/CustomInputText/ > .git/info/sparse-checkout 75git remote add origin https://gitee.com/openharmony/applications_app_samples.git 76git pull origin master 77```