AddView dynamic touch

SpaceCow

Member
Licensed User
Longtime User
Hi,

Is is possible when i dynamically add a Scrollview with AddView to connect a Touch function with it?

Currently i have this in the Activity_Create:
Code: Copy
Dim scvMain As ScrollView
Dim Panel1 As Panel

scvMain.Initialize(500)
Panel1.AddView(scvMain,0,0,100%x,100%y)

Now i want to check if the scvMain is touched but this doesn't work:
Code: Copy
Sub scvMain_Touch (Action As Int, X As Float, Y As Float)
   Msgbox("Test", "test")
End Sub

Can someone help me please? Thanks!
 
i've looked in the manual (page 174)
there are no events for the scrollview
but you can add a panel inside the scrollview
something like this

Code: Copy
Dim p As Panel
p.initialize("zzz")
scvMain.AddView(p, 10,10,1000,1000)
End Sub

Sub zzz_touch (Action As Int, X As Float, Y As Float)
Msgbox ( "zzz" , "ZZZ" )
End Sub
 
Upvote 0
What exactly do you want to do with the Touch event ?
You must be aware that the touch event is cosumed by the ScrollView for vertical or horizontal scrolling.
If you want horizontal and vertical scrolling for a ScrollView you should have a look at the ScrollView2 library.

Beat regards.
 
Upvote 0
Back
Top