0
votes

If remove the ListView, the EditText will be auto adjust screen.

If ListView exist this layout, the adjust screen will be not work and the soft keyboard overlay the EditText box.

why ? How to fix ?

And try to put this line to manifest, but also not work.

android:windowSoftInputMode="stateVisible|adjustResize|adjustPan"

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

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

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="TextView" />

        <ListView
            android:id="@+id/listView1"
            android:layout_width="match_parent"
            android:layout_height="200dip" >
        </ListView>
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <Spinner
            android:id="@+id/spinner1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />

        <EditText
            android:id="@+id/editText1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ems="10" >

            <requestFocus />
        </EditText>
    </LinearLayout>

</LinearLayout>
2

2 Answers

1
votes

Dont use all the three values of android:windowSoftInputMode at one time, all the values have their own significance.

If u want that when u open the keyboard then your editBox should move up and list view should be re-sized,then u try using the following line in you manifest.

android:windowSoftInputMode="adjustResize"
0
votes

use <activity android:windowSoftInputMode="adjustResize"> in your menifest. second add android:transcriptMode="alwaysScroll" property in your <ListView />