Как удалить нижнюю границу с прозрачным фоном в моей ячейке UICollectionView? - PullRequest
0 голосов
/ 03 октября 2018

enter image description here

Я пытался удалить нижнюю границу ячейки CollectionView, но безуспешно.Прилагается мой пример кода: -

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewCell *gridcell = nil;

    MenuDetail_Cell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:MenuDetail_CellID forIndexPath:indexPath];

    cell.layoutMargins = UIEdgeInsetsZero;
    cell.layer.borderWidth = 0;
    cell.clipsToBounds = YES;
    cell.contentView.layer.borderWidth = 0.0;
    cell.contentView.layer.borderColor = [UIColor clearColor].CGColor;
    cell.contentView.layer.masksToBounds = NO;

    cell.strMenuImage = self.imageArray[indexPath.row];
    cell.strMenuTitle = self.titleArray[indexPath.row];
    gridcell = cell;
    return gridcell;
}


- (UICollectionView *)collectionView
{
    if (!_collectionView) {

        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];

        _collectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout];
        _collectionView.delegate = self;
        _collectionView.dataSource = self;
        _collectionView.delaysContentTouches = NO;


            _collectionView.frame = CGRectMake(0, DCTopNavH, ScreenW, ScreenH  - DCBottomTabH);

        _collectionView.showsVerticalScrollIndicator = NO;

        //Cell
        [_collectionView registerClass:[MenuDetail_Cell class] forCellWithReuseIdentifier:MenuDetail_CellID];


        [self.view addSubview:_collectionView];
    }
    return _collectionView;
}

Даже я пытался применить minimumLineSpacingForSectionAtIndex, но все тот же.Любая идея?Извините за мою глупую ошибку, если таковая имеется.Спасибо.

1 Ответ

0 голосов
/ 03 октября 2018

UICollectionView не имеет разделителя, такого как UITableView

Это должно быть где-то в вашем коде, проверьте раскадровку MenuDetail_Cell class

...