scrollTo(index) or scrollTo(item) will position the given index at the top of the ListView if possible, even if it was already showing in the middle.
I have code where I want to make sure the currently selected item is visible if it is changed programmatically. If I use simple code that calls scrollTo when my model changes, it causes visual problems if the model was updated as a result of the user clicking on the ListView. (The item they clicked on snaps to the top of the view.)
I have code where I want to make sure the currently selected item is visible if it is changed programmatically. If I use simple code that calls scrollTo when my model changes, it causes visual problems if the model was updated as a result of the user clicking on the ListView. (The item they clicked on snaps to the top of the view.)
- relates to
-
JDK-8097006 scrollTo bugs
-
- Closed
-