0

i want to make a uicollectionview like this one:

reference

i have no idea, how to make the grid...i can put the image, but no the squares.

i've tried to use another UIImage view but, i need space between cells, so it's pretty useless.

ideas ? (and make it works on iPad too)

Felipe Quirós
  • 430
  • 5
  • 15

2 Answers2

0

Use

collectionViewCell.layer.borderwidth...

Check this question out for the general idea - Adding rounded corner and drop shadow to UICollectionViewCell

Community
  • 1
  • 1
MendyK
  • 1,643
  • 1
  • 17
  • 30
0

Here you need to do two things:

  1. To show grid - Set border of collection view cell layer
  2. To avoid spacing between cells - Create flowlayout object for your collection view:

    UICollectionViewFlowLayout * flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.minimumInteritemSpacing = 0;
    flowLayout.minimumLineSpacing = 0;
    
    
    UICollectionView * collectionview = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:flowLayout];
    
sanjana
  • 3,034
  • 2
  • 25
  • 31