0

After hours googling, I found no solution..

I want to add these attributes to a cell but this code does not work

AppCell *cell = [[AppCell alloc] init];

cell.layer.cornerRadius = 5.0;
cell.layer.shadowColor = [[UIColor blackColor] CGColor];
cell.layer.shadowOpacity = 1.0;
cell.layer.shadowRadius = 10.0;
cell.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);

What is the solution?? .. Thank you very much in advance

Lito
  • 2,309
  • 1
  • 23
  • 29

1 Answers1

2

First,create a CustomCell which is a subclass of UICollectionViewCell.. Then, import that CustomCell.h file into your collectionView's controller.

If you want to set up those properties on some cells, using the delegate method - (UICollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath

If you want to set up those properties for all cells, just put them inside CustomCell.m.Remember import QuartzCore framework.

LE SANG
  • 10,955
  • 7
  • 59
  • 78
Oscar Swanros
  • 19,767
  • 5
  • 32
  • 48