Skip to content

Instantly share code, notes, and snippets.

@jdarowski
Created March 1, 2015 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdarowski/e6a69d144c181c3a9b86 to your computer and use it in GitHub Desktop.
Save jdarowski/e6a69d144c181c3a9b86 to your computer and use it in GitHub Desktop.
Shadowed cells in UICollectionView
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"productCell" forIndexPath:indexPath];
CALayer* layer = cell.layer;
[layer setMasksToBounds:NO];
[layer setShadowColor:[UIColor blackColor].CGColor];
[layer setShadowOffset:CGSizeMake(0.0f, 5.0f)];
[layer setShadowOpacity:0.3f];
[layer setShadowRadius:4.0f];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment