本文整理汇总了C++中CACollectionViewCell::getReuseIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C++ CACollectionViewCell::getReuseIdentifier方法的具体用法?C++ CACollectionViewCell::getReuseIdentifier怎么用?C++ CACollectionViewCell::getReuseIdentifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CACollectionViewCell
的用法示例。
在下文中一共展示了CACollectionViewCell::getReuseIdentifier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clearData
void CAAutoCollectionView::clearData()
{
m_mpUsedCollectionCells.clear();
m_rUsedCollectionCellRects.clear();
m_pSelectedCollectionCells.clear();
m_rCollectionViewSection.clear();
for (int i = 0; i < m_vpUsedCollectionCells.size(); i++)
{
CACollectionViewCell* cell = m_vpUsedCollectionCells.at(i);
CC_CONTINUE_IF(cell == NULL);
m_mpFreedCollectionCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetCollectionViewCell();
}
m_vpUsedCollectionCells.clear();
m_pHighlightedCollectionCells = NULL;
}
示例2: collectionCellAtIndex
CACollectionViewCell* ThirdViewController::collectionCellAtIndex(CACollectionView *collectionView, const CCSize& cellSize, unsigned int section, unsigned int row, unsigned int item)
{
CACollectionViewCell* pCell = new CACollectionViewCell();
char cIdentifier[1024] = { 0 };
sprintf(cIdentifier, "{%d, %d, %d}" ,section, row, item);
pCell->initWithReuseIdentifier(cIdentifier);
CALabel* label = CALabel::createWithCenter(CCRectMake(cellSize.width / 2, cellSize.height - 30, cellSize.width, cellSize.height));
label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);
label->setTextAlignment(CATextAlignmentCenter);
label->setFontSize(28);
label->setText(pCell->getReuseIdentifier());
pCell->addSubview(label);
CAImageView* pCellImage = CAImageView::createWithCenter(CCRectMake(cellSize.width / 2, cellSize.height / 2 - 20, cellSize.width*0.7f, cellSize.height*0.7f));
pCell->addSubview(pCellImage);
pCellImage->setImageAsyncWithFile("1.jpg");
return pCell;
}
示例3: recoveryCollectionCell
void CACollectionView::recoveryCollectionCell()
{
CCRect rect = this->getBounds();
rect.origin = getContentOffset();
rect.origin.y -= rect.size.height * 0.1f;
rect.size.height *= 1.2f;
std::map<CAIndexPath3E, CACollectionViewCell*>::iterator itr;
for (itr = m_pUsedCollectionCells.begin(); itr != m_pUsedCollectionCells.end(); itr++)
{
CACollectionViewCell* cell = itr->second;
CC_CONTINUE_IF(cell == NULL);
CCRect cellRect = cell->getFrame();
CC_CONTINUE_IF(rect.intersectsRect(cellRect));
m_pFreedCollectionCells[cell->getReuseIdentifier()].pushBack(cell);
cell->removeFromSuperview();
cell->resetCollectionViewCell();
itr->second = NULL;
}
}