public virtual CCTableViewCell TableCellAtIndex(CCTableView table, int idx) { string str = idx.ToString(); var cell = table.DequeueCell(); if (cell == null) { cell = new CustomTableViewCell(); var sprite = new CCSprite("Images/Icon"); sprite.AnchorPoint = CCPoint.Zero; sprite.Position = new CCPoint(0, 0); cell.AddChild(sprite); var label = new CCLabelTTF(str, "Helvetica", 20.0f); label.Position = CCPoint.Zero; label.AnchorPoint = CCPoint.Zero; label.Tag = 123; cell.AddChild(label); } else { var label = (CCLabelTTF)cell.GetChildByTag(123); label.Label = (str); } return cell; }
public virtual CCTableViewCell TableCellAtIndex(CCTableView table, int idx) { string str = idx.ToString(); var cell = table.DequeueCell(); if (cell == null) { cell = new CustomTableViewCell(); var sprite = new CCSprite("Images/Icon"); sprite.AnchorPoint = CCPoint.Zero; sprite.Position = new CCPoint(0, 0); cell.AddChild(sprite); var label = new CCLabelTTF(str, "Helvetica", 20.0f); label.Position = CCPoint.Zero; label.AnchorPoint = CCPoint.Zero; label.Tag = 123; cell.AddChild(label); } else { var label = (CCLabelTTF)cell.GetChildByTag(123); label.Label = (str); } return(cell); }