Created
March 1, 2015 12:26
-
-
Save jdarowski/e6a69d144c181c3a9b86 to your computer and use it in GitHub Desktop.
Shadowed cells in UICollectionView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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