键盘在Ionic Android中推动标签 [英] Keyboard is pushing tabs in ionic android

查看:67
本文介绍了键盘在Ionic Android中推动标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于IONIC 3的应用,但遇到了问题.当我单击离子搜索并以ANDROID形式打开键盘时,它只是通过破坏布局并挤压内容来推动App的全部内容.

I’m developing an app on IONIC 3 and i’m having a problem. When I click on the ion search and the Keyboard opens in ANDROID it simply pushes the entire contents of the App by breaking the layout and squeezing the content.

我正在使用 config.xml

and i`m use config.xml

<preference name="Fullscreen" value="true" />

app.component.ts

app.component.ts

this.statusBar.hide();


this.statusBar.overlaysWebView(false)

它的工作!但是,当我进入全屏模式时,它隐藏了我的底部.

Its WORK ! But, when i go to full screen mode it hides my bottom.

请帮助我.

推荐答案

尝试以下代码:

window.addEventListener('keyboardDidShow', () => {
  console.log("Keyboard is open")
  let elements = document.querySelectorAll(".tabbar");

  if (elements != null) {
    Object.keys(elements).map((key) => {
      elements[key].style.display = 'none';
    });
  }
});

window.addEventListener('keyboardWillHide', () => {
  let elements = document.querySelectorAll(".tabbar");

  if (elements != null) {
    Object.keys(elements).map((key) => {
      elements[key].style.display = 'flex';
    });
  }
});

将此代码添加到appcomponent.ts或您面临此问题的特定选项卡中.

Add this code in appcomponent.ts or particular tab where you are facing this issue.

这篇关于键盘在Ionic Android中推动标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆