I have ui::ScrollView with few ui::Buttons inside.
When I touch the button first I can’t use the ScrollView.
setting: button->setSwallowTouches(false);
should mean touch events will be propagated back to the scrollView (when I touch the button).
But they are not.
Only two things help:
remove button->addTouchEventListener(...)
disable touch in button button->setTouchEnabled(false)
I’ve found a slightly hacky solution to this problem:
Instead of using addTouchEventListener I use addClickEventListener. Then I can scroll and I can click the button. And by the way in this case, if I set setSwallowTouches to true it indeed blocks event propagation.
if I setSwallowTouches(false) each time when event occurs it works. Without it works only with first touch. That means something is setting button->setSwallowTouches(true) over and over.
The button can be a part of more complex node, which can move somehow itself, so you may want to move it (or not), by moving finger over button, depending on swallow touches mode.
Yeah, I have a scrollView with many buttons inside. Then swallowTouches is false I should be able to click the button as well as use a scrollView. Not sure why I have to setSwallowTouches(false) over and over to make this working as expected.