CAListView* CAListView::createWithCenter(const CCRect& rect) { CAListView* listView = new CAListView(); if (listView && listView->initWithCenter(rect)) { listView->autorelease(); return listView; } CC_SAFE_DELETE(listView); return NULL; }
CAListView* CAListView::createWithLayout(const CrossApp::DLayout &layout) { CAListView* listView = new CAListView(); if (listView && listView->initWithLayout(layout)) { listView->autorelease(); return listView; } CC_SAFE_DELETE(listView); return NULL; }
bool CDListViewTest::init() { CAListView* listView = CAListView::createWithLayout(DLayout(DHorizontalLayoutFill, DVerticalLayout_T_H(0, 120))); listView->setListViewDelegate(this); listView->setListViewDataSource(this); listView->setAllowsSelection(true); listView->setAllowsMultipleSelection(false); listView->setOrientation(CAListView::Horizontal); //listView->setShowsHorizontalScrollIndicator(false); listView->setShowsScrollIndicators(false); listView->setSeparatorColor(CAColor_clear); this->addSubview(listView); return true; }