3

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.

Community
  • 1
  • 1
user1156041
  • 2,155
  • 5
  • 24
  • 54
  • 3
    "I cann't find the answer in android." Third link found with the search: http://stackoverflow.com/questions/10599451/how-to-make-an-android-view-scrollable-when-the-keyboard-appears – verybadalloc Jul 19 '13 at 04:05
  • thank for ur link. I have footer bar in my view. When I change as ur link, , the footer bar is above the keyboard. I would like to hide the footer bar when keyboard appear. – user1156041 Jul 19 '13 at 04:17

4 Answers4

7

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!

Harsha Alva
  • 394
  • 1
  • 3
  • 18
6

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">

Steve L
  • 345
  • 3
  • 7
1

smoothScrollToPosition method of LilstView class

Pulkit Sethi
  • 1,325
  • 1
  • 14
  • 22
1

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();
}
blyabtroi
  • 2,046
  • 1
  • 15
  • 22