未验证 提交 5ee000ac 编写于 作者: 孙悦 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-inputmethod.md.

Signed-off-by: Nsunyue <sunyue77@h-partners.com>
上级 3f28012f
...@@ -47,9 +47,10 @@ getInputMethodController(): InputMethodController ...@@ -47,9 +47,10 @@ getInputMethodController(): InputMethodController
| [InputMethodController](#InputMethodController) | 回调返回当前客户端实例。 | | [InputMethodController](#InputMethodController) | 回调返回当前客户端实例。 |
**示例:** **示例:**
```js
```js
var InputMethodController = inputMethod.getInputMethodController(); var InputMethodController = inputMethod.getInputMethodController();
``` ```
## inputMethod.getInputMethodSetting<sup>8+</sup> ## inputMethod.getInputMethodSetting<sup>8+</sup>
...@@ -67,9 +68,10 @@ getInputMethodSetting(): InputMethodSetting ...@@ -67,9 +68,10 @@ getInputMethodSetting(): InputMethodSetting
**示例:** **示例:**
```js
```js
var InputMethodSetting = inputMethod.getInputMethodSetting(); var InputMethodSetting = inputMethod.getInputMethodSetting();
``` ```
## InputMethodController ## InputMethodController
...@@ -137,14 +139,15 @@ listInputMethod(callback: AsyncCallback&lt;Array&lt;InputMethodProperty&gt;&gt;) ...@@ -137,14 +139,15 @@ listInputMethod(callback: AsyncCallback&lt;Array&lt;InputMethodProperty&gt;&gt;)
| callback | Array<[InputMethodProperty](#InputMethodProperty)> | 是 | 返回已安装输入法列表。 | | callback | Array<[InputMethodProperty](#InputMethodProperty)> | 是 | 返回已安装输入法列表。 |
**示例:** **示例:**
```js
```js
InputMethodSetting.listInputMethod((properties)=>{ InputMethodSetting.listInputMethod((properties)=>{
for (var i = 0;i < properties.length; i++) { for (var i = 0;i < properties.length; i++) {
var property = properties[i]; var property = properties[i];
console.info(property.packageName + "/" + property.methodId); console.info(property.packageName + "/" + property.methodId);
} }
}); });
``` ```
### listInputMethod ### listInputMethod
...@@ -160,13 +163,14 @@ listInputMethod(): Array&lt;InputMethodProperty&gt; ...@@ -160,13 +163,14 @@ listInputMethod(): Array&lt;InputMethodProperty&gt;
| Promise<Array<[InputMethodProperty](#InputMethodProperty)>> | 返回已安装输入法列表。 | | Promise<Array<[InputMethodProperty](#InputMethodProperty)>> | 返回已安装输入法列表。 |
**示例:** **示例:**
```js
```js
var properties = InputMethodSetting.listInputMethod(); var properties = InputMethodSetting.listInputMethod();
for (var i = 0;i < properties.length; i++) { for (var i = 0;i < properties.length; i++) {
var property = properties[i]; var property = properties[i];
console.info(property.packageName + "/" + property.methodId); console.info(property.packageName + "/" + property.methodId);
} }
``` ```
### displayOptionalInputMethod ### displayOptionalInputMethod
...@@ -183,11 +187,12 @@ displayOptionalInputMethod(callback: AsyncCallback&lt;void&gt;): void ...@@ -183,11 +187,12 @@ displayOptionalInputMethod(callback: AsyncCallback&lt;void&gt;): void
| callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 | | callback | AsyncCallback&lt;void&gt; | 是 | 回调函数。 |
**示例:** **示例:**
```js
```js
InputMethodSetting.displayOptionalInputMethod(()=>{ InputMethodSetting.displayOptionalInputMethod(()=>{
console.info('displayOptionalInputMethod is called'); console.info('displayOptionalInputMethod is called');
}); });
``` ```
### displayOptionalInputMethod ### displayOptionalInputMethod
...@@ -204,6 +209,7 @@ displayOptionalInputMethod(callback: AsyncCallback&lt;void&gt;): void ...@@ -204,6 +209,7 @@ displayOptionalInputMethod(callback: AsyncCallback&lt;void&gt;): void
| Promise&lt;void&gt; | 回调函数。 | | Promise&lt;void&gt; | 回调函数。 |
**示例:** **示例:**
```js
```js
InputMethodSetting.displayOptionalInputMethod(); InputMethodSetting.displayOptionalInputMethod();
``` ```
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册