0

I tried everyhing in this Android: How do I prevent the soft keyboard from pushing my view up?

But none of them not worked for me Here is my xml

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/footer"
        android:layout_below="@+id/header"
        android:isScrollContainer="false">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:orientation="vertical">

      <....Widgets>

     </LinearLayout>
     </scrollview>

     <com.mypackage.activities.Footer
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="@dimen/footerHeight"
        android:layout_alignParentBottom="true"
        />

</RelativeLayout>

As well as in Manifest file used adjustResize,adjsutPan,adjustNothing

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Girish
  • 2,196
  • 2
  • 18
  • 24
  • It would be easier with pictures, so we knew exactly what you're seeing, and what you want. Assuming you want the keyboard to come up over the footer, you need to be in adjustPan mode. – Gabe Sechan Apr 02 '19 at 13:52
  • 1
    If you want to not let the softkeypad to push the footer view up then you should use `adjustnothing` with a vscrollview` as root layout. – Abid Khan Apr 02 '19 at 13:59
  • @GabeSechan with adjustPan footer is getting pushed but scrollview not working – Girish Apr 02 '19 at 14:22
  • @AbidKhan if I make scrollview as root view then footer also gets scrolled, but i don't want footer to be scrolled – Girish Apr 02 '19 at 14:26
  • @GabeSechan typo *footer not getting pushed – Girish Apr 02 '19 at 14:32

1 Answers1

0

Make ScrollView as root layout which will also contain your footer layout. Inside Manifest file use adjustNothing for windowsoftinputmode.

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@+id/footer"
        android:layout_below="@+id/header"
        android:isScrollContainer="false">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:orientation="vertical">

      <....Widgets>

     </LinearLayout>

     <com.mypackage.activities.Footer
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="@dimen/footerHeight"
        android:layout_alignParentBottom="true"/>

</RelativeLayout>
</scrollview>
Abid Khan
  • 2,451
  • 4
  • 22
  • 45