DrownedBat Member Licensed User Longtime User Aug 3, 2015 #1 Good morning all! Back at it and I'm experimenting with Scrollviews. I have one a Scrollview within another Scrollview and although the panel seems to be set to the proper height and .BringtoFront has been called, the second one doesn't want to scroll. What am I missing here? Thanks!
Good morning all! Back at it and I'm experimenting with Scrollviews. I have one a Scrollview within another Scrollview and although the panel seems to be set to the proper height and .BringtoFront has been called, the second one doesn't want to scroll. What am I missing here? Thanks!
barx Well-Known Member Licensed User Longtime User Aug 3, 2015 #2 DrownedBat said: Good morning all! Back at it and I'm experimenting with Scrollviews. I have one a Scrollview within another Scrollview and although the panel seems to be set to the proper height and .BringtoFront has been called, the second one doesn't want to scroll. What am I missing here? Thanks! Click to expand... The fact that you shouldn't put 1 scrollable view within another... Upvote 0
DrownedBat said: Good morning all! Back at it and I'm experimenting with Scrollviews. I have one a Scrollview within another Scrollview and although the panel seems to be set to the proper height and .BringtoFront has been called, the second one doesn't want to scroll. What am I missing here? Thanks! Click to expand... The fact that you shouldn't put 1 scrollable view within another...
barx Well-Known Member Licensed User Longtime User Aug 3, 2015 #4 DrownedBat said: Shouldn't or can't? Click to expand... I think you have already proven that you 'can', because you have, but you shouldn't because it doesn't work. One of the views consumes the scroll event and therefore the other is unresponsive to that same action. Upvote 0
DrownedBat said: Shouldn't or can't? Click to expand... I think you have already proven that you 'can', because you have, but you shouldn't because it doesn't work. One of the views consumes the scroll event and therefore the other is unresponsive to that same action.
EnriqueGonzalez Expert Licensed User Longtime User Aug 3, 2015 #5 there is a work around, i do not know if it is posible to adapt to B4A you must use gesturedetector. set the gesture detector to the inner scroll view and use the reflection library like this (on the event of touch of the inner scroll) Code: Dim r As Reflector r.Target = parentscrollview r.RunMethod2("requestDisallowInterceptTouchEvent", True, "java.lang.boolean") i use it once for a draggable view within a scrollview and worked so i do not really now if it will work for 2 scrollviews. Upvote 0
there is a work around, i do not know if it is posible to adapt to B4A you must use gesturedetector. set the gesture detector to the inner scroll view and use the reflection library like this (on the event of touch of the inner scroll) Code: Dim r As Reflector r.Target = parentscrollview r.RunMethod2("requestDisallowInterceptTouchEvent", True, "java.lang.boolean") i use it once for a draggable view within a scrollview and worked so i do not really now if it will work for 2 scrollviews.
DrownedBat Member Licensed User Longtime User Aug 3, 2015 #6 No luck with this method as yet. The gesturedetector registers a Scroll event only when the scrollview's panel is touched, but not when any loaded views within the panel are (might need to link these). I'll have to try something else with the layout then. Thanks for the help! Upvote 0
No luck with this method as yet. The gesturedetector registers a Scroll event only when the scrollview's panel is touched, but not when any loaded views within the panel are (might need to link these). I'll have to try something else with the layout then. Thanks for the help!
EnriqueGonzalez Expert Licensed User Longtime User Aug 3, 2015 #7 https://www.b4x.com/android/forum/threads/example-drag-a-panel-of-buttons-or-edittext.19962/ you may find this thread helpful, it is for drag again but it teaches how to pass a touch event to the parent only if moving. Upvote 0
https://www.b4x.com/android/forum/threads/example-drag-a-panel-of-buttons-or-edittext.19962/ you may find this thread helpful, it is for drag again but it teaches how to pass a touch event to the parent only if moving.
DrownedBat Member Licensed User Longtime User Aug 4, 2015 #8 Well the bypass does indeed work, it just needs some adjusting. The gesturedetector's scroll event only registers horizontal scrolling and I've had no luck with fling. It works when I first scroll the second scrollview horizontally to trigger the by pass and then scroll vertically. Obviously needs some adjusting but the bypass works. Thanks Enrique Gonzalez R! Upvote 0
Well the bypass does indeed work, it just needs some adjusting. The gesturedetector's scroll event only registers horizontal scrolling and I've had no luck with fling. It works when I first scroll the second scrollview horizontally to trigger the by pass and then scroll vertically. Obviously needs some adjusting but the bypass works. Thanks Enrique Gonzalez R!