在代码中初始化的时候,将subview全部清除就可以了
代码如下:
case 3:{
HomeHotCategoryViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:hotCategoryIdentifier forIndexPath:indexPath];
[(HomeHotCategoryViewCell *)cell setDelegate:self];
[cell.productListScrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
productSpecialListModel *model = productSpecialListArray[indexPath.row];
[(HomeHotCategoryViewCell *)cell setProductDataModel:model];
return cell;
break;
}