tugce
tugce

Reputation: 661

auto grow edittext below buttons above keybord

Yet another same problem for android which drive developers crazy! I want to make buttons above keyboard...

Here is my xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/home"
    android:layout_width="910dp"
    android:layout_height="wrap_content"
    android:focusable="true"
    android:focusableInTouchMode="true"
    android:keepScreenOn="true"
    android:orientation="vertical"
    android:padding="15dip" >

    <com.custom.webview
        android:id="@+id/webView1"
        android:layout_width="900dp"
        android:layout_height="350dp"
        android:visibility="gone" >
    </com.custom.webview>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-light"
        android:paddingBottom="5dip"
        android:paddingTop="20dip"
        android:text="@string/choose_the_outcome"
        android:textAllCaps="true"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="25sp" />

    <Spinner
        android:id="@+id/spinner1"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:entries="@array/call_outcomes" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:fontFamily="sans-serif-light"
        android:paddingBottom="5dip"
        android:paddingTop="20dip"
        android:text="@string/notes"
        android:textAllCaps="true"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="25sp" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:fontFamily="sans-serif-light"
        android:inputType="textMultiLine" >

    </EditText>

    <LinearLayout
        style="?android:attr/buttonBarStyle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="25dip" >

        <Button
            android:id="@+id/button1"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:onClick="onCancel"
            android:text="@android:string/cancel" />

        <Button
            android:id="@+id/button2"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="0.5"
            android:onClick="onSave"
            android:text="@string/save" />
    </LinearLayout>

</LinearLayout>

Upvotes: 0

Views: 221

Answers (3)

Huzi
Huzi

Reputation: 130

You need to to do the following: Just Make the text view child of a spinner or put text view height = wrap_content.

Upvotes: 1

Hareshkumar Chhelana
Hareshkumar Chhelana

Reputation: 24848

Add this line

android:windowSoftInputMode="adjustResize|stateHidden"

to AndroidManifest.xml <activity> tag

Upvotes: 1

Lebedevsd
Lebedevsd

Reputation: 950

just move all your layoouts as they are in the RelativeLayout. It might fix an issue.

Upvotes: 1

Related Questions