Sver Sver - 1 year ago 90
Android Question

How to scroll ListView to the bottom?

I though this would be a simple task, but apparently there is no way to scroll listview to the bottom. All solutions that I found are using variations of

method which only sets selection to last item, but does not scrolls to the bottom of it.

In my case I have a empty listview (with a long empty view header set) and I want to scroll to bottom of it.

So, is there a way to do it?


So for those who are interested the working solution is:

getListView().setSelectionFromTop(0, -mHeader.getHeight());



This also works, with right offset (calculated based on current scroll position), but might give you some unexpected results.

Answer Source

Try using list.scrollTo(0, list.getHeight());

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download