Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to avoid layout being pushed when keyboard invoked

I have a layout as below

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:weightSum="1">
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="wrap_content">
    <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    <Button android:text="Button" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    <Button android:text="Button" android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    <Button android:text="Button" android:id="@+id/button5" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
<ImageButton android:id="@+id/imageButton1" android:src="@android:drawable/stat_notify_sync_noanim" android:layout_height="fill_parent" android:layout_weight="1" android:layout_width="fill_parent"></ImageButton>
<EditText android:id="@+id/editText1" android:layout_height="wrap_content" android:layout_width="match_parent">
    <requestFocus></requestFocus>
</EditText>
</LinearLayout>

when the softkeyboard invoked by clicking on the edit text the whole layou is being pushed. Can i keep the buttons on the header fixed and let the imageview being pushed?? Because buttons are gonna act like navigation bar so it should be there even when the layout is being pushed up.

Before enter image description here

After enter image description here

like image 493
Jay Mayu Avatar asked Aug 11 '11 04:08

Jay Mayu


1 Answers

Out of all properties under android:windowSoftInputMode in manifest the only thing that worked is

android:windowSoftInputMode="adjustNothing"

like image 120
Ravi Avatar answered Nov 15 '22 08:11

Ravi