android - Tabs appear on top of the keyboard in ionic 3 -
i have tabs in footer. when keyboard show, tabs appear on top of keyboard. want tabs hide when keyboard show. there solution in case?
if set view not resize when keyboard open, bottom of webview hidden behind keyboard. unfortunately there no direct way of checking when keyboard opens , closes (i think because devices don't have software keyboard) can listen when view changes size, , make tab bar visible/invisible when appropriate:
rootview.getviewtreeobserver().addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { rect r = new rect(); rootview.getwindowvisibledisplayframe(r); int screenheight = rootview.getrootview().getheight(); int keypadheight = screenheight - r.bottom; if (keypadheight > screenheight * 0.15) { // 0.15 ratio perhaps enough determine keypad height. // keyboard opened mytabview.setvisibility(gone); } else { // keyboard closed mytabview.setvisibility(visible); } } });
Comments
Post a Comment