用工具添加了UIScrollView,然后再代码里面手动添加了几个UITextButton,但是不能滑动了
UIScrollView* testscrollView = UIScrollView::create();
testscrollView->setClippingEnable(true);
testscrollView->setTouchEnable(true);
testscrollView->setSize(CCSizeMake(280, 150));
testscrollView->setPosition(ccp(1100,350));
testscrollView->setInnerContainerSize(CCSizeMake(280, 210));
addChild(testscrollView);
for(int i=0;i<10;i++)
{
UITextButton* testbtn=(UITextButton*)gResManager->loadUITextButton(90001);
if(testbtn)
{
std::string cityName="testName";
testbtn->setText(cityName.c_str());
testbtn->setFontSize(25);
testbtn->setScale9Size(CCSizeMake(168,73));
testbtn->setPosition(ccp(90,322-i*94));
testscrollView->addChild(testbtn );
}
}
是还要设置什么属性吗,请开发人员帮忙看看