1
votes

I have an edittext at the bottom of my chat view. When the soft keyboard opens, it pushes the whole view up, so it sits atop the keyboard which stretch background image. I actually want it to open keyboard over backgournd and shifts edittext up.

Anyone else run into this issue? Know how to fix it?

1
what u exactly mean ? it looks like you want to shift edittext to top but not entire view ??Avinash
yes you are right, i want thisGaurav Berry

1 Answers

0
votes

Add this in ur manifest

android:windowSoftInputMode="adjustResize"

For Example : Modify ur manifest like this

<activity
        android:name="com.example.admob.MainActivity"
        android:label="@string/app_name"
        android:windowSoftInputMode="adjustResize" >

This will work .. Now The Entire layout will be shifted Up . .But If u add ur image as background image it will not be shifted.

EX: android:background="@drawable/background"

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/xxx"
    android:orientation="vertical" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:background="@drawable/background">
</RelativeLayout>

Now the edittext and the other views will be shifted but not the image