Skip to content

Instantly share code, notes, and snippets.

@jdarowski
Created March 1, 2015 12:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdarowski/93b9afa4ef2660256a1b to your computer and use it in GitHub Desktop.
Save jdarowski/93b9afa4ef2660256a1b to your computer and use it in GitHub Desktop.
Borders and rounded corners in UICollectionView
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"productCell" forIndexPath:indexPath];
CALayer* layer = cell.layer;
[layer setCornerRadius:4.0f];
[layer setBorderColor:[UIColor colorWithWhite:0.8 alpha:1].CGColor];
[layer setBorderWidth:1.0f];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment