Android Soft Keyboard not showing all `EditText`

First of all let me say that I have tried in the manifest android:windowSoftInputMode="adjustPan|stateHidden"

and android:windowSoftInputMode="adjustResize|stateHidden"

and the result is the same.

I have a layout with a header and footer and in between there is ScrollView

. Inside this, I have RelativeLayout

and inside this layout, I have one EditText

and LinearLayout

containing the other EditText

(this layout makes sense in my application).

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/scroll"
    android:layout_below="@+id/header"
    android:fillViewport="true"
    android:layout_above="@+id/footer">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingBottom="40dp">

        <EditText
            android:id="@+id/one"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:background="@drawable/edittextback"
            android:layout_marginBottom="40dp" />

        <LinearLayout
            android:id="@+id/placeholder"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/one"
            android:gravity="center"
            android:orientation="vertical"
            android:visibility="gone"
            android:layout_marginBottom="40dp">

            <EditText
                android:id="@+id/two"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/edittextback"
                android:gravity="center"/>
        </LinearLayout>
    </RelativeLayout>
</ScrollView>

      

When I go into action and start typing in the first editor, the keyboard appears, the scrolling increases a little so I can see the text I am pasting. The problem is that the edittext is not all visible (I mean the bottom border). The keyboard only stays on pasting the pasted text, not on the bottom of the edittext.

Now, since I already have a keyboard, I scroll down a bit to see the top of the second edittext. When I touch the second edittext it gets focus and now it automatically scrolls slightly differently than the first edittext, that is, enough to see the inserted text, but at the bottom of the edittext making the edittext visible. This is what I want.

How can I force the behavior to always show all edittext?

+3


source to share





All Articles