2017-06-19 44 views
0

我在調整Android上的佈局時出現問題,當鍵盤出現在屏幕上時,一半的webview隱藏在鍵盤下我想讓它自己調整 到目前爲止我的代碼是我在調整Android上的佈局時出現屏幕上出現軟鍵盤問題

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/backgroundmap" 
    tools:context="com.example.adeel.abc.newmessage"> 

      <WebView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/messengerWeb"> 
      </WebView> 
</RelativeLayout> 

,並在清單文件中的代碼是

<activity android:name=".newmessage" 
     android:theme="@style/Theme.AppCompat.Light.NoActionBar" 
     android:windowSoftInputMode="adjustPan"> 
    </activity> 

我可以試圖對計算器,但其中非許多解決方案正在與 的WebView犯規調整本身 好心請幫我在做我的代碼更好 非常感謝 問候

回答

0

更改活動的windowSoftInputMode屬性:

android:windowSoftInputMode="adjustResize" 
+1

它的工作非常感謝 –