首页 > 其他分享 >APP 监听手机键盘是否弹出

APP 监听手机键盘是否弹出

时间:2022-09-19 15:57:43浏览次数:54  
标签:hide show APP param 键盘 false ev 监听 native

/**
 * 监听键盘是否弹出
 * @param show
 * @param hide
 */
export const addEventKeyboardStatus = (show,hide)=>{
    window.addEventListener('native.keyboardshow',(ev)=>{
        show(ev)
    },false)

    window.addEventListener('native.keyboardhide',(ev)=>{
        hide(ev)
    },false)

}

/**
 * 移除监听键盘的事件
 * @param show
 * @param hide
 */
export const removeKeyboardStatus = (show,hide)=>{
    window.removeEventListener('native.keyboardshow',(ev)=>{
        show(ev)
    },false)

    window.removeEventListener('native.keyboardhide',(ev)=>{
        hide(ev)
    },false)
}

 

标签:hide,show,APP,param,键盘,false,ev,监听,native
From: https://www.cnblogs.com/dandanyajin/p/16707899.html

相关文章