Question

What I want to do is to scroll view after listening a button. Simply user taps button and view is scrolled to specific id below.

I tried to use scrollto and scrollby passing as an argument reference to object to which I want to scroll with no effect.

Anyone solved this problem yet?

Was it helpful?

Solution

I have spent many hours on this.

Try something like this. It makes sure that the item selected it the one in view:

ListView listView;
int positionSelected = listView.getSelectedItemPosition(); listView.setSelection(positionSelected);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top