Catalin
Catalin

Reputation: 762

Android keyboard cut EditText

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

Upvotes: 4

Views: 2895

Answers (2)

kaushal trivedi
kaushal trivedi

Reputation: 3443

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

Upvotes: 1

Volodymyr Lykhonis
Volodymyr Lykhonis

Reputation: 2976

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.

Upvotes: 3

Related Questions