CATableViewCell* RootViewController::tableCellAtIndex(CATableView *table, unsigned int section, unsigned int row) { CATableViewCell* cell = table->dequeueReusableCellWithIdentifier("aaa"); if (cell == NULL) { cell = CATableViewCell::create("aaa"); //cell->setBackGroundView(NULL); } CCString* str = CCString::createWithFormat("CELL - %u", row); CCLabelTTF* ttf = CCLabelTTF::create(str->getCString(), "Arial", 40); ttf->setColor(ccBLACK); ttf->setFrame(CCRect(10, 60, 0, 0)); cell->addSubview(ttf); // CALabel* label = CALabel::create(CCRect(0, 0, 600, 100)); // label->setOpacity(128); // label->setVerticalTextAlignmet(kCCVerticalTextAlignmentCenter); // label->setCenterOrigin(CCPoint(300, 60)); // label->setText(str->getCString()); // cell->addSubview(label); return cell; }
CAView* RootViewController::tableViewSectionViewForFooterInSection(CATableView* table, unsigned int section) { CAView* view = CAView::createWithFrame(CCRect(0, 0, 0, 0), ccc4(200, 255, 200, 255)); CCString* str = CCString::createWithFormat("Footer - %u", section); CCLabelTTF* ttf = CCLabelTTF::create(str->getCString(), "Arial", 20); ttf->setColor(ccc3(127, 127, 127)); ttf->setFrame(CCRect(10, 10, 0, 0)); view->addSubview(ttf); return view; }
void FirstViewController::viewDidLoad() { // Do any additional setup after loading the view from its nib. CAImageView* imageView = CAImageView::createWithImage(CAImage::create("9m.jpg")); imageView->setFrame(CCRect(200, 300, 330, 214)); this->getView()->addSubview(imageView); CCLabelTTF* ttf = CCLabelTTF::create("Hello World!", "Arial", 50); ttf->setColor(ccBLACK); ttf->setFrame(CCRect(200, 450, 0, 0)); this->getView()->addSubview(ttf); }