Android Question scroll a listview so that a specific line is just above the keyboard [solved]

Didier9

Well-Known Member
Licensed User
Longtime User
The title says it all.

I want to scroll a listview up (or down) so that a particular line is located just above the keyboard (or as a minimum such that the line is visible) when the keyboard is opened.

I know I have seen how to do this in the forum and I am even pretty sure I have used it in one of my apps but now I can't find it anywhere...

Any help appreciated!
 

Didier9

Well-Known Member
Licensed User
Longtime User
Thanks for the reply. I did see that post but it's not what I remembered.
I did find what I was looking for. It does not always work but it is very useful when it does. It is simply calling the SetSelection( i ) method on the listview. It moves it so that the selected item (i in this case) is visible.
However the post you referenced may be a more effective method, I will try it.
 
Upvote 0
Top