UICollectionView adds top margin

前端 未结 9 1679
走了就别回头了
走了就别回头了 2020-12-04 14:06

I want to put a UICollectionView control that shows thumbs horizontally (only a single line of thumbs). For some reason the UICollectionView push the thumbs 44 pixels down,

9条回答
  •  孤城傲影
    2020-12-04 14:23

    Maybe you can try to force this value at 0 using the Delegate flow layout of collection view :

    - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
    {
        return UIEdgeInsetsMake(PADDING_TOP, PADDING_LEFT, PADDING_BOTTOM, PADDING_RIGHT);
    }
    

    Modify the value of your padding.

提交回复
热议问题