1

I have a button at the bottom of my view, and I would like that when my editText is interacted with that the button remains on top of the soft keyboard. How can I force this? Here is how my layout is formatted. Please also note that this is a fragment inside of a view pager (if that matters).

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fl_parent"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        ... some code
    </LinearLayout>

    <!-- button at bottom -->
    <LinearLayout
        android:id="@+id/bottom_wrapper"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <!-- next button -->
        <Button
            android:id="@+id/btn_next"
            android:layout_width="match_parent"
            android:layout_height="54dp"
            android:layout_gravity="bottom" />
    </LinearLayout>
</FrameLayout>
portfoliobuilder
  • 7,556
  • 14
  • 76
  • 136

1 Answers1

2

try adding this in your manifest.xml for particular Activity

android:windowSoftInputMode="adjustResize"

in manifest it will look like below code:-

<activity
         android:name=".YourActivity"
         android:label="@string/label"
         android:windowSoftInputMode="adjustResize">
        </activity>
Shishram
  • 1,514
  • 11
  • 20
  • I have done this and it does not work. I believe this is because the view is inside of a container, because I am using a view pager as I mentioned before. – portfoliobuilder Oct 08 '15 at 19:38