# uni.hideKeyboard(options)

隐藏键盘

# hideKeyboard 兼容性

Web 微信小程序 Android iOS HarmonyOS
4.0 4.41 4.71 4.71 4.61

# 参数

名称 类型 必填 默认值 兼容性 描述
options HideKeyboardOptions -
-
uni.hideKeyboard参数定义
名称 类型 必备 默认值 兼容性 描述
success (res: HideKeyboardSuccess) => void -
uni.hideKeyboard成功回调函数定义
fail (res: HideKeyboardFail) => void -
uni.hideKeyboard失败回调函数定义
complete (res: any) => void -
uni.hideKeyboard完成回调函数定义

# 参见

# uni.onKeyboardHeightChange(callback)

监听键盘高度变化事件

# onKeyboardHeightChange 兼容性

Web 微信小程序 Android iOS HarmonyOS
- 4.41 4.71 4.71 -

# 参数

名称 类型 必填 默认值 兼容性 描述
callback (res: OnKeyboardHeightChangeCallbackResult) => void -
uni.onKeyboardHeightChange参数定义

# OnKeyboardHeightChangeCallbackResult 的属性值

名称 类型 必备 默认值 兼容性 描述
height number -
键盘高度

# 返回值

类型
number

# 参见

# uni.offKeyboardHeightChange(id)

移除键盘高度变化事件的监听函数

# offKeyboardHeightChange 兼容性

Web 微信小程序 Android iOS HarmonyOS
- 4.41 4.71 4.71 -

# 参数

名称 类型 必填 默认值 兼容性 描述
id number - -

# 参见

# 通用类型

# GeneralCallbackResult

名称 类型 必备 默认值 兼容性 描述
errMsg string -
错误信息