android keyboard moves tabs

2019-03-25 13:30发布

问题:

So I have an Ionic/Phonegap app that I just built using ionic start myApp tabs then I added an input on one of the views. When I focus the input using an android emulator or device, the keyboard come up but so do the tabs. Do I have to explicitly hide the tabs whenever the keyboard is active on android? I would think this would be a common issue but I haven't seen any complaints. Do I just have a bad project or something?

回答1:

You can change the activity properties in the manifest.xml

<activity android:windowSoftInputMode="adjustPan"> </activity>

Look at the example: http://rickluna.com/wp/2014/03/phonegap-3-adjustpan-with-fullscreen-theme/



回答2:

Add following css classes in your Style.ccs

/* Hide bottom tab bar when keyboard appears*/
.keyboard-open .has-tabs {
    bottom: 0;
}

body.keyboard-open .has-footer {
    bottom: 0;
}

above css classes will do the trick of hiding bottom tab bar when keyboard appears.