From 07051a035725728c07276579d3826ebb9ed43188 Mon Sep 17 00:00:00 2001 From: Zen <843968788@qq.com> Date: Fri, 12 Feb 2016 21:21:57 +0800 Subject: [PATCH] Let ScrollView swallow touch events by default. --- extensions/GUI/CCScrollView/CCScrollView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 23d6144574..915ba3c703 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -190,6 +190,7 @@ void ScrollView::setTouchEnabled(bool enabled) if (enabled) { _touchListener = EventListenerTouchOneByOne::create(); + _touchListener->setSwallowTouches(true); _touchListener->onTouchBegan = CC_CALLBACK_2(ScrollView::onTouchBegan, this); _touchListener->onTouchMoved = CC_CALLBACK_2(ScrollView::onTouchMoved, this); _touchListener->onTouchEnded = CC_CALLBACK_2(ScrollView::onTouchEnded, this);