减少集合视图中特定单元格的间距?

时间:2017-06-26 14:58:07

标签: ios objective-c uicollectionview

我在集合视图中显示了几个单元格,其中一些单元格是配对的(立体声音频通道),我希望它们合并为一个看似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;
}

0 个答案:

没有答案