cocos2d-x3.0 ListView(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-05-26 10:56 点击:次
& items = listView->getItems();
ssize_t items_count = items.size();
for (int i = 0; i < count / 4; ++i) {
Button* custom_button = Button::create("button.png","buttonHighlighted.png");
custom_button->setName("Title Button");
custom_button->setScale9Enabled(true);
custom_button->setSize(default_button->getSize());
Layout* custom_item = Layout::create();
custom_item->setSize(custom_button->getSize());
custom_button->setPosition(Point(custom_item->getSize().width / 2.0f, custom_item->getSize().height / 2.0f));
custom_item->addChild(custom_button);
listView->insertCustomItem(custom_item, items_count);
}
//set item data
items_count = items.size();
for (int i = 0; i < items_count; ++i) {
Widget* item = listView->getItem(i);
Button* button = static_cast