1
I created a RelativeLayout
property match_parent
height so you can fill the entire screen. Inside it I insert a LinearLayout
property alignParentBottom
having value true
to secure the element to the footer.
When I click and focus on EditText
, my keyboard superimposes the element. I would like that LinearLayout
remained fixed on top of device keyboard.
To be clear I took this image from the Twitter app:
Code:
<RelativeLayout xmlns: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>
Just below is a GIF showing the top code working. When is given the focus on EditText
, the gray part is superimposed by the keyboard. I’ve tried using android:windowSoftInputMode="adjustPan|adjustResize"
in my Activity
, but it didn’t work.
How do I make my element remain fixed on top of the keyboard without being overlaid?
Leonardo, it doesn’t work that way.
– viana