我在集合视图中显示了几个单元格,其中一些单元格是配对的(立体声音频通道),我希望它们合并为一个看似1个按钮,而不是让其他单元格具有通用集合视图填充。
有没有办法可以删除2个特定单元格之间的填充以合并为1个更大的单元格?也许去除对中第一个细胞的右手填充?或者这超出了集合视图的范围?
这是我的委托方法:
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
CDCBusSelectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
NSString *busNameString = [self.busNamesRecieved objectAtIndex:indexPath.row];
cell.busNameCell.text = busNameString;
NSNumber *busStereoState = [self.busStereoStateRecieved objectAtIndex:indexPath.row];
NSInteger busIntState = [busStereoState integerValue];
if (busIntState == 1) {
// stereo -- need to merge cells or something
[cell setBackgroundColor:[UIColor colorWithRed:255 green:90 blue:127 alpha:1.0]];
}
return cell;
}