2016-06-09 44 views
0

試圖在過去的幾天內解決這個問題並無濟於事。安卓鍵盤通過推動離子含量取代了離子含量

我嘗試了一些不同的建議: How to prevent keyboard push up webview at iOS app using phonegap

https://forum.ionicframework.com/t/ios-keyboard-push-content-out-of-view/6715/last

https://github.com/driftyco/ionic/issues/5432

但他們都不上班,或者至少沒有解決我的問題。

我實現了「離子彈性聊天」功能在我的應用程序: https://codepen.io/rossmartin/pen/XJmpQr

然而,當我專注於輸入文本區域,鍵盤不包括離子含量,但它取代它看起來,鍵盤的高度。

enter image description here 測試消息,我不得不「盲目」進入,然後按硬件後退按鈕,鍵盤消失,並恢復正常。

這個問題也發生在另一個屏幕上,但它發生一次我第一次專注於我的搜索欄,但其他所有其他時間是正常的。

enter image description here 正如你在這裏看到的那樣,它將它推起來,你可以看到光標在哪裏。

我app.jssettings

 ionic.Platform.isFullScreen = true; 
     if (window.cordova && window.cordova.plugins.Keyboard) { 
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 
      cordova.plugins.Keyboard.disableScroll(true); 
     } 

,我嘗試其他設置:

window.addEventListener('native.keyboardshow', keyboardShowHandler); 

    function keyboardShowHandler(e){ 
     setTimeout(function() { 
      $('html, body').animate({ scrollTop: 0 }, 1000); 
     }, 0); 
    }  

回答

4

最後我設法解決這個問題,就在我張貼了這個問題:

對別人說可能有這個問題,對我來說有效的是:

在AndroidManifes t.xml文件(位於platforms \ android目錄中),將屬性更改爲:

android:windowSoftInputMode="adjustPan" 

<activity 
    ... 
    ... 
    android:windowSoftInputMode="adjustPan"> 
... 
</activity> 
+0

非常感謝!經過幾小時的搜索,這解決了我的問題:) – Boldizsar