Android Question scroll view event name

ArminKH

Well-Known Member
hi
what is the event name for an array of scroll view?
for example i add 3 scroll view like this
B4X:
Dim SV(3) AS ScrollView
now i want to handle _ScrollChanged Event but i'm failed by this code
B4X:
Sub SV_ScrollChanged(Position As Int)
        Log("Changed")
End Sub
!!!!!
or some thing like this
B4X:
Sub SV(0)_ScrollChanged(Position As Int)
        Log("Changed")
End Sub
thanks
 

ArminKH

Well-Known Member
oppppppppps sorry
i missed Initialize2 and found it after 1 min
:D
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
When you initialize the ScrollViews you must need
B4X:
SV(i).Initialize2(500, "SV")
Set SV(i).Tag = i

And
B4X:
Sub SV_ScrollChanged(Position As Int)
    Dim scv As ScrollView
    scv = Sender
    Dim Index As Int
    Index = scv.Tag
    Log("ScrollView index:" & Index)
    Log("Changed")
End Sub
 
Upvote 0

ArminKH

Well-Known Member
When you initialize the ScrollViews you must need
B4X:
SV(i).Initialize2(500, "SV")
Set SV(i).Tag = i

And
B4X:
Sub SV_ScrollChanged(Position As Int)
    Dim scv As ScrollView
    scv = Sender
    Dim Index As Int
    Index = scv.Tag
    Log("ScrollView index:" & Index)
    Log("Changed")
End Sub
Yes thank u
As i said i forgot to use initialize2
 
Upvote 0
Top