Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Coping0606
Docs
提交
c72af87d
D
Docs
项目概览
Coping0606
/
Docs
与 Fork 源项目一致
Fork自
OpenHarmony / Docs
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
c72af87d
编写于
8月 16, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 16, 2022
浏览文件
操作
浏览文件
下载
差异文件
!8146 输入法框架新增接口说明
Merge pull request !8146 from 赵凌岚/master
上级
f0a6a662
bf0158d2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
102 addition
and
0 deletion
+102
-0
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
+102
-0
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-inputmethod.md
浏览文件 @
c72af87d
...
...
@@ -173,6 +173,108 @@ stopInput(): Promise<boolean>
console
.
info
(
'
stopInput isSuccess =
'
+
isSuccess
);
```
### showSoftKeyboard<sup>9+</sup> ###
showSoftKeyboard(callback: AsyncCallback
<
void
>
): void
显示软键盘,使用callback异步回调。
**系统能力:**
SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback
<
void
>
| 是 | 回调函数。 |
**示例:**
```
js
InputMethodController
.
showSoftKeyboard
((
err
)
=>
{
if
(
err
==
undefined
)
{
console
.
error
(
'
showSoftKeyboard success
'
);
}
else
{
console
.
info
(
'
showSoftKeyboard failed :
'
+
JSON
.
stringify
(
err
));
}
})
```
### showSoftKeyboard<sup>9+</sup> ###
showSoftKeyboard(): Promise
<
void
>
显示软键盘,使用Promise异步回调。
**系统能力:**
SystemCapability.MiscServices.InputMethodFramework
**返回值:**
| 类型 | 说明 |
| ------------------- | ------------------------- |
| Promise
<
void
>
| 无返回结果的Promise对象。 |
**示例:**
```
js
InputMethodController
.
showSoftKeyboard
().
then
(
async
(
err
)
=>
{
console
.
log
(
'
showSoftKeyboard success
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
showSoftKeyboard fail
'
+
JSON
.
stringify
(
err
));
});
```
### hideSoftKeyboard<sup>9+</sup> ###
hideSoftKeyboard(callback: AsyncCallback
<
void
>
): void
隐藏软键盘,使用callback异步回调。
**系统能力:**
SystemCapability.MiscServices.InputMethodFramework
**参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback
<
void
>
| 是 | 回调函数。 |
**示例:**
```
js
InputMethodController
.
hideSoftKeyboard
((
err
)
=>
{
if
(
err
==
undefined
)
{
console
.
error
(
'
hideSoftKeyboard success
'
);
}
else
{
console
.
info
(
'
hideSoftKeyboard failed :
'
+
JSON
.
stringify
(
err
));
}
})
```
### hideSoftKeyboard<sup>9+</sup> ###
hideSoftKeyboard(): Promise
<
void
>
隐藏软键盘,使用Promise异步回调。
**系统能力:**
SystemCapability.MiscServices.InputMethodFramework
**返回值:**
| 类型 | 说明 |
| ------------------- | ------------------------- |
| Promise
<
void
>
| 无返回结果的Promise对象。 |
**示例:**
```
js
InputMethodController
.
hideSoftKeyboard
().
then
(
async
(
err
)
=>
{
console
.
log
(
'
hideSoftKeyboard success
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
hideSoftKeyboard fail
'
+
JSON
.
stringify
(
err
));
});
```
## InputMethodSetting<sup>8+</sup>
下列API示例中都需使用
[
getInputMethodSetting
](
#inputmethodgetinputmethodcontroller
)
回调获取到InputMethodSetting实例,再通过此实例调用对应方法。
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录