I have a horizontal scrollview like below with V as an overlay and it acts like a pointer:
V
[ 0 ] , [ 1 ] , [ 2 ] , [ 3 ] , [ 4 ] , [ 5 ]
^
When I scroll, I would like to print the value or index that is in the current pointer. Eg. scroll until [2] and it will print "2".
V
[ 2 ] , [ 3 ] , [ 4 ] , [ 5 ]
^
Could you guide me on how to achieve this?