[SOLVED] Ui::ScrollView scrolling upside down?

I’ve read similar issues about this [here] (http://stackoverflow.com/questions/14693302/cocos2d-x-ccscrollview-is-scrolling-upside-down) and [here] (CCScrollview is scrolling upside down), but those are dealing with the old extensions::CCScrollView, not ui::ScrollView. These two classes don’t share exactly the same API.
Other users are having trouble with this class too.

Here’s what I’m using:

scrollLayer = ui::ScrollView::create();
scrollLayer->setDirection(ui::ScrollView::Direction::VERTICAL);
scrollLayer->setTouchEnabled(true);
scrollLayer->setBounceEnabled(true);
scrollLayer->setContentSize(OVERLAY_SIZE);
scrollLayer->setInnerContainerSize(Size(OVERLAY_SIZE.width, OVERLAY_SIZE.height*2));
scrollLayer->setPosition(Point::ZERO);
scrollLayer->addChild(myContent); // myContent is a menu

layer->addChild(scrollLayer);

Expected behavior: the extra space in the inner container (1 OVERLAY_SIZE.height extra) should be present at the end of the ScrollView.

Current behavior: the extra space in the inner container shows up before all of the content, at the top of the ScrollView. I can’t scroll down to see the rest of my content, and ScrollView::scrollToTop again reveals that the extra space is at the top, not the bottom like I want.

Any tips?

I seemed to have fixed it by increasing the Y-position of the content by the difference between the two containers myself.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.