一般情況下:iOS在config.xml中

設置

 1 <preference name="KeyboardShrinksView" value="false" /> 

Android  在AndroidManifest.xml 中添加

 1 <activity android:windowSoftInputMode="adjustResize"> 

 

上面的二個都是讓鍵盤彈出時,键盘将会覆盖到页面上方而不会挤压页面内容;

在ionic 中 有一個方法是 鍵盤彈出時,隱藏可能被擠壓到的div ;class="hide-on-keyboard-open"

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

或者添加 plugin 的方式 https://github.com/driftyco/ionic-plugins-keyboard.

詳細內容 查查文檔 

文檔 keyboard

posted on 2014-10-10 15:35  ทดสอบ  阅读(482)  评论(0)    收藏  举报