【发布时间】:2013-06-12 13:31:39
【问题描述】:
问题是我有一个UICollectionView,并且我有一个从UICollectionViewCell 继承的自定义单元格。现在我在UICollectionView 上拥有的是左右两个按钮,当我单击右键时,单元格应该会更改,并且下一个应该出现在图片中。单元格有一个 TextView。单击右键时,下一个单元格(带有 textview)应该在图片中。类似地,单击左侧应该显示上一个。
谢谢和最好的问候。
CellforRow:
-(UICollectionViewCell*)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
if (collectionView == self.myCV) {
myCollectionView *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MY_CELL" forIndexPath:indexPath];
if (cell == nil)
{
NSArray *xibPath = [[NSBundle mainBundle] loadNibNamed:@"myCollectionView" owner:self options:nil];
cell = [xibPath objectAtIndex:0];
}
return cell;
}
else if (collectionView == self.myCV2)
{
myCC2 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MY_CELL2" forIndexPath:indexPath];
if (cell == nil)
{
NSArray *xibPath = [[NSBundle mainBundle] loadNibNamed:@"myCC2" owner:self options:nil];
cell = [xibPath objectAtIndex:0];
}
return cell;
}
return 0;
}
【问题讨论】:
标签: ios ios6 uicollectionview