Lukap
Lukap

Reputation: 31963

Layout issue when the keyboard is shown

This is my app when the soft keyboard is hidden enter image description here But when the keyboard is shown then the edittext box on the top is gone (it is push up). enter image description here and it looks like this.

My question is how can I keep both edit-boxes visible when the keyboard is shown? I want only the space in between the edit boxes to be reduced... but both boxes to be visible

my layout so far is like this

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="fill_parent" android:layout_width="fill_parent"
    android:id="@+id/relativeLayout1">
    <EditText android:id="@+id/editText1" android:layout_height="wrap_content"
        android:layout_alignParentTop="true" android:layout_width="fill_parent">
        <requestFocus></requestFocus>
    </EditText>
    <EditText android:id="@+id/editText2" android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" android:layout_width="fill_parent"></EditText>
    <ImageView android:id="@+id/imageView1"
        android:layout_height="wrap_content" android:layout_below="@id/editText1"
        android:layout_above="@id/editText2" android:background="@drawable/icon"
        android:layout_width="fill_parent"></ImageView>
</RelativeLayout>

Upvotes: 1

Views: 2406

Answers (1)

Micah Hainline
Micah Hainline

Reputation: 14437

Go to your Android manifest and change the "Window soft input mode" from adjustPan, which moves the entire view, to adjustResize, which will resize the view for you.

Upvotes: 5

Related Questions