S SpaceCow Member Licensed User Longtime User Aug 1, 2012 #1 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!
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!
stefanobusetto Active Member Licensed User Longtime User Aug 1, 2012 #2 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
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
klaus Expert Licensed User Longtime User Aug 1, 2012 #3 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
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.
S SpaceCow Member Licensed User Longtime User Aug 2, 2012 #4 I used the SlidingPanels: http://www.b4x.com/forum/basic4andr...ple-way-create-sliding-layouts.html#post46263 and added your "Another ScrollView example": http://www.b4x.com/forum/basic4android-share-your-creations/8417-another-scrollview-example.html in it. When i slide sideways on de ScrollView, the slidingpanels doesn't work. So i thought i had to add the touch member of ScrollView to activate it but that didn't work. Upvote 0
I used the SlidingPanels: http://www.b4x.com/forum/basic4andr...ple-way-create-sliding-layouts.html#post46263 and added your "Another ScrollView example": http://www.b4x.com/forum/basic4android-share-your-creations/8417-another-scrollview-example.html in it. When i slide sideways on de ScrollView, the slidingpanels doesn't work. So i thought i had to add the touch member of ScrollView to activate it but that didn't work.
klaus Expert Licensed User Longtime User Aug 2, 2012 #5 You should have a look at corwin42s' AHViewPager library. Best regards. Upvote 0