Android: Listview not moving from keyboard

My layout is as follows:

<LinearLayout> <RelativeLayout> Some Image and Text as Title </RelativeLayout> <RelativeLayout> <LinearLayout> <ListView> My message List </ListView> </LinearLayout> <RelativeLayout> Edit Box and Send Button </RelativeLayout> </RelativeLayout> </LinearLayout> 

I show the current selection to the last (newest) lists when showing.

When you do not enter text in the "Edit" box below, the screen looks like this:

 Top Title List Item 8 List Item 7 ... List Item 2 List Item 1 Bottom Edit box and Send Button 

When I click on the "Edit" field to enter my message, the screen looks like this:

 Top Title List Item 8 ... List Item 5 Bottom Edit Box and Send Button Keyboard 

I really want:

 Top Title List Item 4 ... List Item 1 Bottom Edit Box and Send Button Keyboard 

Can anybody help me?

+7
source share
2 answers

I found the answer here .

Basically just extend the ListView with your custom class, override the onSizeChanged () method for setSelection (getCount ());

This seems like the best solution, and it looks like Google Voice is using the same tactics (because if you are at the top of the chat list, then rotate the screen, it brings you back).

Also remember that android: windowSoftInputMode = "adjustResize" is present instead of customPan in your activity tags in your manifest.

+11
source

Have you tried this one ?

You will need to use setTranscriptMode(ListView.TRANSCRIPT_MODE_NORMAL) and setStackFromBottom(true) in your list. Hope this helps, it worked for me!

+2
source

All Articles