Hi, I’m working on cocos2dx 3.12 version.
I have a scrollview. I added a listview to it.
And when I drag it by listview , ScrollView does not move. It moves only when I drag it itself.
Means when I scroll using listview it is not scrolling but if I scroll from other part of scrollview it scrolls properly.
Any ideas how to fix this?
my scrollview is-
scrollView = ui::ScrollView::create( );
scrollView->setDirection( ui::ScrollView::Direction::VERTICAL );
scrollView->setContentSize( Size( 480, 1124 ) );
scrollView->setInnerContainerSize(Size(480, 1324));
scrollView->setBackGroundImage( "appbg.png" );
scrollView->setBounceEnabled(true);
scrollView->setTouchEnabled(true);
scrollView->setAnchorPoint( Vec2( 0.5, 0.5 ) );
scrollView->setPosition( Vec2( visibleSize.width / 2 + origin.x, visibleSize.height / 2 + origin.y) );
scrollView->setScrollBarEnabled(false);
this->addChild( scrollView );
my listview is -
listView = ui::ListView::create();
// listView->setDirection(ui::ScrollView::Direction::VERTICAL);
listView->setTouchEnabled(true);
listView->setBounceEnabled(true);
listView->setSize(Size(visibleSize.width, (visibleSize.height/4)));
listView->setDirection( ui::ScrollView::Direction::HORIZONTAL );
listView->setClippingEnabled(true);
listView->setAnchorPoint(Vec2::ZERO);
listView->setPosition(Vec2::ZERO);
listView->setPosition(Vec2(00,700+200));
listView->setSwallowTouches(true);
listView->setItemsMargin(0);
listView->setScrollBarEnabled(false);
scrollView->addChild(listView);
I added ImageView to listview
imageView = ui::ImageView::create(writablePath.c_str());
imageView->setPosition(imageView->getContentSize()/2);
imageView->setTouchEnabled(true);
listView->pushBackCustomItem(imageView );
Thanks.