Bring Scrollview Item to Top

Bill Norris

Active Member
Licensed User
Longtime User
Am in search of an efficient way to programatically find an item in a scrollview column and bring that item to the top of the scroll view. What I am doing now is looping through each label on the scrollview (scrollview is only one column of labels), and keeping a running total of the height of all the rows it passes through while searching. When it finds the item, I set the scroll position to the value of that running total. Works like a charm, but just wondering if there isn't a better way.
 

Bill Norris

Active Member
Licensed User
Longtime User
RE: Answered My Own Question

All I have to do is set the scrollview.position to the value of TOP of the matching view. The only thing I don't care for is that the "scroll" doesn't happen fast enough so the user sees the list rapidly scrolling up until it gets to the desired spot.
 
Upvote 0
Top