头部引用.h页面
include “extensions/cocos-ext.h”
include “ui/CocosGUI.h”
USING_NS_CC;
USING_NS_CC_EXT;
using namespace ui;
.cpp页面
ui::ScrollView* scrollView = ui::ScrollView::create();
scrollView->setContentSize(Size(500,150));
scrollView->setPosition(Vec2(50,170));
this->addChild(scrollView);
scrollView->setInnerContainerSize(Size(500,250));
auto xs = Label::createWithSystemFont("hello world","Microsoft YaHei",18);
xs->setAnchorPoint(Point(0,0));
xs->setPosition(Point(200,224-i*30));
scrollView->addChild(xs);
这样就可以使用了。这个事我看的官方测试案例里面就有了