ScrolView inside another one

Hi gues,

Is it possible to insert one ScrollView to another. That parent ScrollView scrolls only horizontally and child scroll only vertically?

I’ve tried to do that, but I can’t dispatch events from child ScrollView to parent using takeFocus method.

Thanks in advance

I believe the scrollview (child) will ‘consume’ the event, thus the events do not go to the lower layers.

You can try ‘return false’ after the event, and see whether it helps (it doesn’t in my experiments).

it doesn’t work :frowning: I mean, that if I put return false into child scrollview listener, parent scrollview didn’t get back the event

That’s what I encountered too. The other option is to pass the focus to the parent/child depending on their x/y movement. See : http://docs.coronalabs.com/api/type/ScrollViewWidget/takeFocus.html

In my implementation, when the child-scroll-view detects y-movement, it will pass the focus to parent. 

I believe the scrollview (child) will ‘consume’ the event, thus the events do not go to the lower layers.

You can try ‘return false’ after the event, and see whether it helps (it doesn’t in my experiments).

it doesn’t work :frowning: I mean, that if I put return false into child scrollview listener, parent scrollview didn’t get back the event

That’s what I encountered too. The other option is to pass the focus to the parent/child depending on their x/y movement. See : http://docs.coronalabs.com/api/type/ScrollViewWidget/takeFocus.html

In my implementation, when the child-scroll-view detects y-movement, it will pass the focus to parent. 

Hi did you resolve that problem? I’m trying to do something like that too… Hope you reply

Hi did you resolve that problem? I’m trying to do something like that too… Hope you reply