Scrollview "Pointer"

Bill Norris

Active Member
Licensed User
Longtime User
I am trying to come up with a cool way to show the user that there is more information in a horizontal scrollview than is currently visible. Like an arrow that points to the right if there is more stuff off the screen, then disappears when scrolled all the way. Another arrow would point to the left in similar fashion as appropriate. I can probably figure it out but just wondering if somebody else already has. I assume I will use the scrollposition property? BTW, just what exactly is scrollposition. Is it base on the number of rows in the scroll, the panel width or what? Please note my app is for tablet, locked to horizontal orientation -- that is why I keep referring to horizontal scrollview.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Here:
B4X:
Sub Globals
   Dim hv As HorizontalScrollView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   hv.Initialize(5000dip, "hv")
   Activity.AddView(hv, 0, 0, 100%x, 100%y)
   hv.Panel.Color = Colors.Blue
   hv_ScrollChanged(0)
End Sub

Sub hv_ScrollChanged(Position As Int)
   Dim moreRight, moreLeft As Boolean
   moreLeft = Position > 0
   moreRight = Position + hv.Width < hv.Panel.Width
   Activity.Title = "MoreLeft = " & moreLeft & ", MoreRight = " & moreRight
End Sub
 
Upvote 0
Top