Khrystyna Pochynok
Khrystyna Pochynok

Reputation: 248

Softkeyboard overlaps multilineEditText

I have multiline EditText in ScrollView. I need to make the whole EditText visible when keyboard is shown. Now it overlaps the bottom part of EditText showing only first line. I have already read a lot of questions here, tried adjustPan/adjustResize combinations etc but nothing really helps.

Upvotes: 0

Views: 115

Answers (4)

Jaydeep Chauhan
Jaydeep Chauhan

Reputation: 146

<EditText
        android:id="@+id/et_feedback"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:lines="8"
        android:maxLines="10"
        android:minLines="6"
        android:padding="10dp"
        android:gravity="top|left"
        android:inputType="textMultiLine"
        android:background="@drawable/et_bg"
        android:scrollbars="vertical" />

Upvotes: 4

Mohan Srinivas
Mohan Srinivas

Reputation: 312

Place all your views in a top level ScrollView so that the content can be scrolled when the screen is not as tall as you exepct. It's not a good idea to assume the height of the screen for general layout purposes. Always use a ScrollView if you want your content to be scrollable on all screen sizes and orientations and keyboard states.

Upvotes: 0

sid.s
sid.s

Reputation: 315

use the following xml code for your edittext:

 <EditText
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="10dp"/> 

Upvotes: 0

Tigger
Tigger

Reputation: 9130

In AndroidManifest.xml:

<activity
    android:configChanges="orientation|keyboardHidden|screenSize"
    android:windowSoftInputMode="adjustResize"
    ...

windowSoftInputMode is the key but personally I found the configChanges help too.

And some more info on Handling Input Method Visibility

Upvotes: 0

Related Questions