diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md index 9255268884dd9aafe6f6a28f262b650f43e48e72..c462a94e28d4ae3bb129516596d281b02131bcef 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethod.md @@ -180,7 +180,7 @@ let currentIme = inputMethod.getCurrentInputMethod(); ## inputMethod.switchCurrentInputMethodSubtype9+ -switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback): void +switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback\): void 在当前输入法应用内切换子类型。 @@ -263,8 +263,6 @@ getCurrentInputMethodSubtype(): InputMethodSubtype 获取当前输入法子类型。 -**需要权限**: ohos.permission.CONNECT_IME_ABILITY - **系统能力**: SystemCapability.MiscServices.InputMethodFramework **返回值:** @@ -281,7 +279,7 @@ let currentImeSubType = inputMethod.getCurrentInputMethodSubtype(); ## inputMethod.switchCurrentInputMethodAndSubtype9+ -switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback): void +switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback\): void 切换至指定输入法应用的指定子类型,用于跨输入法应用切换子类型。 @@ -346,12 +344,16 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ```js let inputMethodProperty = { - packageName:"com.example.kikakeyboard", - methodId:"ServiceExtAbility" + name: "com.example.kikakeyboard", + id: "ServiceExtAbility" } let inputMethodSubProperty = { - id: "com.example.kikainput", - label: "ServiceExtAbility" + id: "com.example.kikakeyboard", + name: "", + locale: "", + label: "ServiceExtAbility", + language: "", + extra : {} } try { inputMethod.switchCurrentInputMethodAndSubtype(property, subType).then((result) => { @@ -490,6 +492,8 @@ showSoftKeyboard(callback: AsyncCallback<void>): void 显示软键盘,使用callback异步回调。参数个数为1,否则抛出异常。 +**需要权限**: ohos.permission.CONNECT_IME_ABILITY + **系统能力:** SystemCapability.MiscServices.InputMethodFramework **参数:** @@ -516,6 +520,8 @@ showSoftKeyboard(): Promise<void> 显示软键盘,使用Promise异步回调。参数个数为0,否则抛出异常。 +**需要权限**: ohos.permission.CONNECT_IME_ABILITY + **系统能力:** SystemCapability.MiscServices.InputMethodFramework **返回值:** @@ -540,6 +546,8 @@ hideSoftKeyboard(callback: AsyncCallback<void>): void 隐藏软键盘,使用callback异步回调。参数个数为1,否则抛出异常。 +**需要权限**: ohos.permission.CONNECT_IME_ABILITY + **系统能力:** SystemCapability.MiscServices.InputMethodFramework **参数:** @@ -566,6 +574,8 @@ hideSoftKeyboard(): Promise<void> 隐藏软键盘,使用Promise异步回调。参数个数为0,否则抛出异常。 +**需要权限**: ohos.permission.CONNECT_IME_ABILITY + **系统能力:** SystemCapability.MiscServices.InputMethodFramework **返回值:** @@ -927,11 +937,13 @@ try { ### showOptionalInputMethods9+ - showOptionalInputMethods(): Promise<void> +showOptionalInputMethods(): Promise<void> - 显示输入法选择对话框。使用promise形式返回结果。参数个数为0,否则抛出异常。 +显示输入法选择对话框。使用promise形式返回结果。参数个数为0,否则抛出异常。 + +**需要权限**: ohos.permission.CONNECT_IME_ABILITY - **系统能力**: SystemCapability.MiscServices.InputMethodFramework +**系统能力**: SystemCapability.MiscServices.InputMethodFramework **返回值:**