dandanyajin
今天更新博客了吗?
/**
 * 监听键盘是否弹出
 * @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)
}

 

posted on 2022-09-19 15:40  dandanyajin  阅读(38)  评论(0编辑  收藏  举报