1

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?

Gaurav Berry
  • 131
  • 9

1 Answers1

0

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

Avinash
  • 123
  • 1
  • 12
  • I tried this android:windowSoftInputMode="adjustResize", its works but The Entire layout will be shifted Up and I am using Linearlayout – Gaurav Berry Jul 03 '14 at 08:50
  • How did you add ur image ? Whether its background image or Imageview ? – Avinash Jul 03 '14 at 08:59
  • Its backgound image of linearlayout. – Gaurav Berry Jul 03 '14 at 09:04
  • Can u post screenshots Before Shifting up and after shifting up ? – Avinash Jul 03 '14 at 09:15
  • Same problem here..Try that solution : http://stackoverflow.com/questions/4287473/android-soft-keyboard-resizes-background-image – Avinash Jul 03 '14 at 09:20
  • Yes. Before shifting https://onedrive.live.com/redir?resid=A242370F52E73382!193&authkey=!AHuMt_5Hx0KZsVc&v=3&ithint=photo%2c.jpg After shifting- https://onedrive.live.com/redir?resid=A242370F52E73382!192&authkey=!AOiphMDPu-ZrDOc&v=3&ithint=photo%2c.jpg – Gaurav Berry Jul 03 '14 at 09:24
  • Have u tried this ? Same problem here..Try that solution : http://stackoverflow.com/questions/4287473/android-soft-keyboard-resizes-background-image – Avinash Jul 03 '14 at 09:50
  • Yes i tried this also not working but i solved my issue. Thanks – Gaurav Berry Jul 03 '14 at 09:52