您好我想禁用uicollectionview的第一个单元格时编辑mode.I的确在cellforrow第一小区的UICollectionview用户交互禁用,禁用其他几个细胞也对滚动
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
MainCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
cell.curveimageView.image = nil;
if(indexPath.item == 0){
[cell.curveimageView setImage:[UIImage imageNamed:@"AddCell"]];
cell.subTitleText.text = @"New Cell";
if(isEditing){
[cell setUserInteractionEnabled:NO];
[cell setAlpha:0.5];
}
else{
[cell setUserInteractionEnabled:YES];
[cell setAlpha:1];
}
}
else{
[cell.curveimageView setImage:[UIImage imageNamed:@"FlowerImage"]];
cell.subTitleText.text = [NSString stringWithFormat:@"%ld%@",(long)indexPath.row,@"Hello is this looking ok"];
}
[cell setTag:indexPath.row];
return cell;
}
下面的代码在第一次在编辑模式下,我可以让用户单击所有单元格,但在滚动后,第一行中的几个单元格会随机禁用。任何人都可以为我提供解决此问题的解决方案。
谢谢
Thanku,上面说的解决方案为我工作。 – SMS