软键盘没有推动webview内容,也没有调整大小

Fre*_*red 5 android

简单地说,在webview中加载内容并点击文本字段后,我的应用程序拒绝调整大小或平移.

这是我的设置

我有一个包含多个片段的Activity.这是片段容器的布局.

 <android.support.v4.widget.DrawerLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"      
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent" 
    android:layout_height="match_parent">
    <!-- MAIN CONTENT -->
    <FrameLayout 
       android:id="@+id/container"
       android:layout_width="match_parent"
       android:layout_height="match_parent"   
       android:background="@android:color/white" />

    <RelativeLayout
       android:layout_width="240dp"
       android:layout_height="match_parent"
       android:layout_gravity="start">

       <!-- ... -->
    </RelativeLayout>
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)

这是webview片段的布局.

<RelativeLayout   
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include
        android:id="@+id/tbOnlinePayment"
        layout="@layout/toolbar" />

    <WebView
        android:layout_below="@+id/tbOnlinePayment"
        android:id="@+id/paymentWebView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <ProgressBar
        android:id="@android:id/progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"/>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我的应用程序的主题延伸 Theme.AppCompat.Light.DarkActionBar

我尝试过的:

  • 就像它写在网络上我试过两个android:windowSoftInputMode="adjustResize"android:windowSoftInputMode="adjustPan".
  • 我知道全屏android:windowSoftInputMode="adjustResize"无法使用,但我不会手动强制执行此操作.我在这里放置应用程序的主题,因为也许有人知道这个主题以某种方式强制全屏.
  • 基于上面的假设我添加<item name="android:windowFullscreen">false</item>到应用程序的主题,但仍然没有结果.
  • 包装webview在一个scrollview.
  • webview高度改为wrap_content.
  • 基本上经历了大部分SO帖子和解决方案.

我想要的:

我不关心webview是调整大小还是推高.我想要的是键盘不隐藏输入字段.

Alp*_*nel 2

我试过:

    <activity
        android:name="com.myapp.MainActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:windowSoftInputMode="adjustResize">
Run Code Online (Sandbox Code Playgroud)

调整大小解决了这个问题。