Reputation: 2195
I would like to know that is there any way to do in android like this question. I used ListView
and add the EditText
in it. I got same problem as above question. I cann't find the answer in android.
Thanks.
Upvotes: 3
Views: 6712
Reputation: 2076
If it's a kind of sms list view, this could be achieved by adding in the manifest this line:
android:windowSoftInputMode="adjustResize"
and adding a touch listener to edit view:
myEditView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
myView.postDelayed(new Runnable() {
@Override
public void run() {
myListView.setSelection(myAdapter.getCount());
}
}, 500);
return false;
}
});
and
@Override
protected void onResume()
{
myEditView.postDelayed(new Runnable() {
@Override
public void run() {
myListView.setSelection(myAdapter.getCount());
}
}, 500);
super.onResume();
}
Upvotes: 1
Reputation: 365
I had the same problem with the keyboard overlapping the listview, but android:windowSoftInputMode="adjustPan" didn't work for me.
However, android:windowSoftInputMode="adjustResize" did.
<activity android:name=".MyActivity" android:label="@string/app_name" android:windowSoftInputMode="adjustResize">
Upvotes: 6
Reputation: 394
In your manifest, try this
<activity android:name=".MyActivity" android:label="@string/app_name" android:windowSoftInputMode="adjustPan">
</activity>
What you need is android:windowSoftInputMode="adjustPan"
Try!
Upvotes: 7