Here is a modded version of the clv_ScrollChanged event:
Code:
Sub CLV_ScrollChanged (Offset As Int)
Dim hh As Int = TopPanel.Height
If Offset < -30 Then
If TopPanel.Parent.IsInitialized = False Then
CLV.InsertAt(0, TopPanel, "loading_" & "-5")
TopPanel.GetView(1).Text = "Pull to refresh"
TopPanel.Color = Colors.RGB(42, 49, 55)
CLV.sv.ScrollViewOffsetY = TopPanel.Height + CLV.DividerSize
Else
If TopPanel.Parent.IsInitialized Then
If Offset < TopPanel.Height Then
Refresh
End If
TopPanel.GetView(1).TextSize = 20 * (TopPanel.Height - Offset) / TopPanel.Height
End If
End If
Else If Offset > hh Then
If TopPanel.Parent.IsInitialized = True Then
TopPanel.RemoveViewFromParent
CLV.RemoveAt(0)
refreshloading.Hide
End If
End If
End Sub
with this code, you dont need scroll the list first down to add the refresh layout.
I have test it in my IOS App and it works very well, thanks!