TootsieRockNRoll
TootsieRockNRoll

Reputation: 3288

Android ListView with edittext in items

I have a ListView where every item has an EditText, when I focus on the last items the soft keyboard appears, but the EditText does not so it stays in the bottom of the screen, what can I do ?

I have this in my manifest

android:windowSoftInputMode="adjustPan|adjustResize"

Upvotes: 0

Views: 829

Answers (2)

Pararth
Pararth

Reputation: 8134

Try using Adapter's getLastVisiblePostition:
http://developer.android.com/reference/android/widget/AdapterView.html#getLastVisiblePosition()

Then on the click of EditText, setSelection for the ListView(depending on the height of soft keyboard and each item row of the ListView);
http://developer.android.com/reference/android/widget/AdapterView.html#setSelection(int)

Upvotes: 0

fiipi
fiipi

Reputation: 663

I would suggest you to make the listview scroll to the clicked EditText, so (I guess) it will be displayed in the visible part of the screen. As in this question Programmatically scroll to a specific position in an Android ListView, you should identify which item has been clicked and then scroll to it.

Upvotes: 1

Related Questions