Exemplo n.º 1
0
    static TestCustomTableView* create(TableViewDataSource* dataSource, Size size)
    {
        auto table = new (std::nothrow) TestCustomTableView();
        table->initWithViewSize(size, nullptr);
        table->autorelease();
        table->setDataSource(dataSource);
        table->_updateCellPositions();
        table->_updateContentSize();

        return table;
    }
Exemplo n.º 2
0
GridView* GridView::create(const Size& size, Node* container)
{
    auto gridView = new (std::nothrow) GridView();
    if (gridView && gridView->initWithViewSize(size, container))
    {
        gridView->autorelease();
        return gridView;
    }
    CC_SAFE_DELETE(gridView);
    return nullptr;
}