iOS Question Identify when Scroll changed End

Luiz Fernando Orlandini

Active Member
Licensed User
I need to identify when the scroll changed event ends, to launch a new action.

In b4a, it's possible to do with a timer, using reflect library, but in B4I we don't have this library.

How can I identify when scroll changed event has ended to launch a new action.

Thanks
 

Erel

Administrator
Staff member
Licensed User
The attached class wraps a ScrollView and uses a timer to raise the event after the user stopped scrolling it.

Usage example:
B4X:
Sub Process_Globals
   Public App As Application
   Public NavControl As NavigationController
   Private Page1 As Page
   Private sv As MyScrollView
End Sub

Private Sub Application_Start (Nav As NavigationController)
   NavControl = Nav
   Page1.Initialize("Page1")
   Page1.Title = "Page 1"
   Page1.RootPanel.Color = Colors.White
   NavControl.ShowPage(Page1)
   sv.Initialize(Me, "sv")
   Page1.RootPanel.AddView(sv.InnerSV, 0, 0, 100%x, 100%y)
   sv.InnerSV.ContentHeight = 200%y
End Sub

Private Sub Page1_Resize(Width As Int, Height As Int)
   sv.InnerSV.ContentWidth = 100%x
End Sub

Sub sv_ScrollChanged
   Log("scroll changed")
End Sub
 

Attachments

Top