简体   繁体   中英

Disable scrolling in listview on refresh

the problem is I so some changes on the list and than it is always scrolling to the top. I know that I can make to scroll to the bottom but that is not what I want. I want to disable scrolling, I mean when I do a change on the list I want the to stay there I do not want to scroll to the top. I just want my scroll to do not change(just to stay in the same place where it is) I try to do this to set the transcrip mode of the list to disabled, but it still after the change the list go to the top.

lv.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_DISABLED);

If you call setAdapter you can't avoid that your list is scrolling back to top. But it will stay at the same position if you call notifyDataSetChanged on the list adapter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM