TListBox scrolling effect
One such solution might be to use
and check if it is smaller
TListBox.Parent.Height + TListBoxItem.height
. Also, create a global variable
such as "MouseIsDown".
Since every item inside the TListBox is actually a child object that you can work with and modify directly, just create a big empty one
and make sure it is set as the last object in the list.
in to True, and
set it to false.
to TListBox with interpolation property set to
set to false, disable this effect, and when
set to true, enable the effect. You will need to do some work before resetting the list position to the last valid object. Perhaps do this in an event of
the animation itself.
It would be more appropriate to calculate the position of this last object and set the
animation to that value.
Essentially you need to check if the coordinates of the final valid object (i.e. not a large empty object) in the list match the height of the list. If they do, and the mouse isn't turned off, the animation will be on and the scrolling will bounce. If they match and the mouse doesn't work, the animation is disabled and as such
won't even be fired, and therefore the scrolling won't reset its position.
You will probably need to do an iterative nested procedure to check that each value is true.
It won't be as smooth as the iOS implementation, but it should give you something to work with.
source to share