0

i'm looking for a solution to make my webview wrapped in relative layout be pushed off the screen from the top and and be squished or be overlayed by the soft keyboard. Ive used adjustPan in the current state, the dream state is what i want to achieve. Using adjustResize squishes my webview, to adjust for the lost height by the keyboard, I don't want that either. I prefer the ios way of pushing the entire webview up, so that the action bar overshoots the screen boundaries (if required).

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/activity_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="com.in.thewizards.MainActivity">

    <WebView
        android:id="@+id/webView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:hardwareAccelerated="true"
        android:allowClearUserData="false"
        android:scrollbars="none"/>
</RelativeLayout>

enter image description here

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Sarabjit
  • 129
  • 3
  • 13

2 Answers2

0

Use adjustResize value for your activity in AndroidManifest.xml Like this:

<activity
    android:name=".presentationLayer.screens.chatScreen.view.ChatScreenActivity"
    android:screenOrientation="portrait"
    android:theme="@style/App.NoActionBar.Theme"
    android:windowSoftInputMode="adjustResize" />
Alex Shevelev
  • 681
  • 7
  • 14
0

add this in your manifest

android:configChanges="keyboardHidden|orientation|screenSize"    
android:windowSoftInputMode="adjustResize|adjustPan"
pratik vekariya
  • 1,105
  • 1
  • 8
  • 14