Anirudh
Anirudh

Reputation: 3358

Unable to see EditText in Custom ListView due to keyboard

I have a Listview with Edittexts which get added dynamically. I used BaseAdapter to populate my listview. Keyboard is blocking the view of few Edittexts at the bottom. How do i prevent this ?

I tried adding this is Manifest, but it doesn't work.

android:windowSoftInputMode="adjustResize"

Upvotes: 0

Views: 254

Answers (3)

Shail Adi
Shail Adi

Reputation: 1510

Use this in your activity tag in manifest file

 android:windowSoftInputMode="adjustPan"

as in :

 <activity android:name="com.exmple.activity"
        android:label="@string/app_name" 
        android:screenOrientation="portrait"
        android:windowSoftInputMode="adjustPan"
        > 

Upvotes: 1

Neha Nathani
Neha Nathani

Reputation: 544

Use android:windowSoftInputMode="adjustPan" instead. It will shift layout up.

Upvotes: 0

Shobhit Puri
Shobhit Puri

Reputation: 26007

I am not sure but I was having the same problem with ScrollView. So, what I did was, I scrolled everything inside the view to the maximum top(1000 was too high, so it scrolled till the place it could). This brought everything above the keyboard.

ScrollView sv;
sv.post(new Runnable() { 
    @Override
    public void run() { 
         sv.scrollTo(0, 10000);
    } 
});

So, everything was above the keyboard, whenever any additional elements were added by the user at bottom. I haven't seen your code, but this idea might help you. All the best.

Upvotes: 0

Related Questions