Urgent please Scrollview is not scrolling when I scroll from it's children listview

Urgent please Scrollview is not scrolling when I scroll from it's children listview
0.0 0

#1

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.


#2

You have 2 problems with your posts:

  1. using old cocos2d-x, nobody will help you in that case, always use latest version
  2. not provided any code example, again nobody will help you, because it’s not a because this is not guessing of something.

#3

Thanks for replay. I edited my question.

Please somebody help me.


#4

I think what you refer is as design. why would you like the layout to scroll when you try to scroll inside listview ? I dont see anyt reason to do so.


#5

Hi thanks for your replay I have added many widgets to scroll view.
And I want to scroll hole page.