4

Hello I have a vertical scrollview which contains multiple textView.

At the bottom i got a EditText, just lika a messagin application. I seted in my manifest android:windowSoftInputMode="adjustPan".

The problem is that when I tap on editText my layout goes up which is good but the keyboard cut my editText in half like in the picture.

 <ScrollView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="8"
    android:background="#CCCCCC" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"

        android:orientation="vertical" >
           //many textView
          <TextView
            android:id="@+id/text_area"
            android:layout_width="fill_parent"
            android:layout_height="50dp"
            android:background="#FF0000"
            android:layout_marginBottom="15dp"
            android:paddingLeft="10dp"
            android:textColor="#168191" />

          </LinearLayout>
</ScrollView>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:orientation="horizontal"
    android:weightSum="10" >

    <EditText
        android:id="@+id/send_msg"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="8"
        android:background="#CCDEDC"
        android:paddingLeft="20dp"
        android:text="Large Text"
        android:textColor="#168191"
        android:textSize="15dp" />
        <Button
        android:id="@+id/send_msg_btn"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="2"
        android:background="#CCCCCC"
        android:text="Send"
        android:textColor="#FFFFFF" />
</LinearLayout>

printscreen

Catalin
  • 752
  • 1
  • 16
  • 32
  • I think you will have to put the LinearLayout with EditText and Button into the scrollview as well. They are not under Scrollview tag, so "adjustPan" is not working for them. – Yogesh Somani Aug 14 '12 at 05:54
  • 1
    You need to check all the answers given to [this question](http://stackoverflow.com/questions/8000795/android-keyboared-overlaps-with-the-edittext-with-printscreens). And you will surely found one solution to your problem. – MKJParekh Aug 14 '12 at 06:07

2 Answers2

3

Add to AndroidManifest.xml following option to the activity you want to see "not-cutted" text by keyboard. android:windowSoftInputMode="adjustPan|stateHidden"

UPD May be you need change padding of your edittext style, because seems it is custom one.

Volodymyr Lykhonis
  • 2,936
  • 2
  • 17
  • 13
  • Thank you for your response. I added "android:windowSoftInputMode="adjustPan|stateHidden" and removed left padding but I still have the same problem :( – Catalin Aug 14 '12 at 00:36
1

use android:windowSoftInputMode="adjustResize" in actvity tag of your manifest. It will show all of your view above the softKeyboard.

kaushal trivedi
  • 3,405
  • 3
  • 29
  • 47