I created a RelativeLayout
with property match_parent
at the time so I can fill the entire screen. Inside it I insert a LinearLayout
with property alignParentBottom
having value true
to fix the element in the footer.
When I click and focus on EditText
, my keyboard overlaps the element. I would like this LinearLayout
to remain fixed on the device keyboard.
To be clearer I took this image from the Twitter application:
Code:
<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="O que esta acontecendo?"
android:layout_alignParentEnd="true"
android:layout_alignParentStart="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="#666"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true">
</LinearLayout>
</RelativeLayout>
Below is a GIF showing the code above running. When the focus on EditText
is given, the gray part is overridden by the keyboard. I already tried to use android:windowSoftInputMode="adjustPan|adjustResize"
in my Activity
, but it did not work.
How do I make my element stay fixed to the top of the keyboard without overlapping?