简体   繁体   English

在Ionic中打开键盘时隐藏广告

[英]Hide ad when keyboard is open in Ionic

I have an admob advertisement at the bottom of my app. 我的应用程序底部有一个admob广告。 When I click on the input box in the footer of my page, not only does the keyboard pop up but the advertisement does too. 当我单击页面页脚中的输入框时,不仅弹出键盘,而且广告也弹出。 How do I hide the advertisement so i just have keyboard and input. 我如何隐藏广告,所以我只有键盘和输入。

If you want to hide any html element when the keyboard shows up you just have to add the 'hide-on-keyboard-open' class on the element. 如果要在键盘显示时隐藏任何html元素,只需在该元素上添加“ hide-on-keyboard-open”类。

From Ionic docs: 从离子文档:

To hide an element when the keyboard is open, add the class hide-on-keyboard-open. 要在打开键盘时隐藏元素,请添加“ hide-on-keyboard-open”类。

<div class="hide-on-keyboard-open"> <div id="google-map"></div> </div>

将此代码添加到您的config.xml中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM