Burak Dede
Burak Dede

Reputation: 3743

Part of my layout goes upward with keyboard

My android app have a layout like this when i open keyboard two imageview at the bottom of the page shows up over the keyboard , i couldnt see the problem why it goes upward with the keyboard can you help me about this ?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <LinearLayout
        android:id="@+id/searchLinear"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@color/upperbackground">

           <EditText
            android:id="@+id/searchBox"
            android:layout_alignParentTop="true"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:layout_margin="12dip"
            android:paddingLeft="35dip"
            android:textSize="15sp"
            android:background="@drawable/search_bar"/>

    </LinearLayout>

    <LinearLayout
            android:id="@+id/searchButtons"
            android:layout_below="@id/searchLinear"
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical|center_horizontal"
            android:background="@color/upperbackground">    

        <ImageView
            android:id="@+id/btnSukela"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:clickable="true"
            android:focusable="true"
            android:onClick="sukelaClickEvent"
            android:paddingRight="8dip"
            android:paddingBottom="5dip"
            android:src="@drawable/sukela"/>

        <ImageView
            android:id="@+id/btnSearch"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toRightOf="@+id/btnSukela"
            android:clickable="true"
            android:focusable="true"
            android:onClick="searchEntryClickEvent"
            android:paddingLeft="8dip"
            android:paddingBottom="5dip"
            android:src="@drawable/search"/>

    </LinearLayout>

    <RelativeLayout
        android:id="@+id/bottomLinear"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical|center_horizontal"
        android:background="@drawable/bottom_back">     

        <ImageView  
            android:id="@+id/btnToday"
            android:src="@drawable/today"
            android:background="@color/bottombackground"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/bottomLinear"
            android:layout_marginBottom="19dip"
            android:layout_centerVertical="true"
            android:clickable="true"
            android:focusable="true"
            android:onClick="todayClickEvent"/> 

        <ImageView  
            android:id="@+id/btnPopular"
            android:src="@drawable/popular"
            android:background="@color/bottombackground"
            android:layout_toRightOf="@+id/btnToday"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:clickable="true"
            android:focusable="true"
            android:onClick="popularClickEvent"/>

    </RelativeLayout>   

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_below="@+id/searchButtons"
        android:layout_above="@+id/bottomLinear"
        android:background="@color/background">

        <ListView
            android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>

    </RelativeLayout>

</RelativeLayout>

Upvotes: 3

Views: 1719

Answers (1)

Josh Lee
Josh Lee

Reputation: 177500

I think you need to set the soft input mode:

<activity android:windowSoftInputMode="adjustPan" ...>

in your manifest, so the window will not resize when the keyboard appears.

Upvotes: 7

Related Questions