2017-06-19 43 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

它的工作非常感谢 –