android - Listview: smooth scroll to bottom -


when button clicked, app smoothly scroll bottom of listview. implementation (kotlin)

listview.post { listview.smoothscrolltoposition(adapter.count - 1) } 

however, not work properly: list items contain expandable parts (i.e. view visibility can visible or gone), hidden. when these parts expanded however, function not scroll end, position before end.

how can reliably scroll end of listview?

try following. solve problem, tried , works great.

listview.post(new runnable(){              public void run() {              listview.setselection(listview.getcount() - 1);     }}); 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -