自定义 ListView
. //弄了一晚上 终于弄出来了 简直是 ListView* lv = ListView::create(); lv->setSize(Size(540, HEIGHT_MAX - 300)); for (int i = 0; i < 5; i++) { Widget*w = Widget::create(); auto sp = Sprite::create("bg_bottom_all.png"); sp->setPositionX(540 / 2); sp->setPositionY(100); w->addChild(sp); w->setContentSize(Size(540,200)); lv->pushBackCustomItem(w); } lv->setBounceEnabled(true); lv->setItemsMargin(30); lv->setPosition(Point(540 / 2, HEIGHT_MAX / 2)); this->addChild(lv); lv->setAnchorPoint(Vec2(0.5, 0.5));