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
android android-layout android-edittext


source to share


No one has answered this question yet

Check out similar questions:

3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2735
Stop EditText from getting focus when Activity starts
2609
Is there a unique identifier for an Android device?
1152
Difference between gravity and layout_gravity on Android
823
Place the cursor at the end of the text in the EditText
641
Limit text length of EditText in Android
418
How to show soft keyboard when edittext is focused
318
Android: auto show soft keyboard when focus is on EditText



All Articles
Loading...
X
Show
Funny
Dev
Pics