Skip to content

Instantly share code, notes, and snippets.

@justincbeck
Created August 12, 2014 18:22
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 justincbeck/f942f6fa162e11995e89 to your computer and use it in GitHub Desktop.
Save justincbeck/f942f6fa162e11995e89 to your computer and use it in GitHub Desktop.
CALayer *mask = [CALayer layer];
mask.contents = (id)[[UIImage imageNamed:@"student_image_mask"] CGImage];
mask.frame = CGRectMake(0, 0, 80, 80);
[imgView.layer setCornerRadius:40.0];
[imgView.layer setBorderColor:[UIColor whiteColor].CGColor];
[imgView.layer setBorderWidth:3.0];
[imgView setBackgroundColor:[UIColor colorWithWhite:220.0/255.0 alpha:1.0]];
imgView.layer.mask = mask;
imgView.layer.masksToBounds = YES;
imgView.layer.shouldRasterize = YES;
imgView.layer.rasterizationScale = [[UIScreen mainScreen] scale];
@presstartgames
Copy link

//    [[self collectionView] setFrame:frame];
//    [[self collectionView] setClipsToBounds:NO];
//    [[[self collectionView] layer] setBorderWidth:1.0];
//    [[[self collectionView] layer] setBorderColor:[UIColor colorWithWhite:65.0/255.0 alpha:1.0].CGColor];
//    [[[self collectionView] layer] setShadowRadius:100.0];
//    [[[self collectionView] layer] setShadowOpacity:0.5];
//    [[[self collectionView] layer] setShadowOffset:CGSizeMake(1.0, 1.0)];
////    [[[self collectionView] layer] setShadowPath:[[UIBezierPath bezierPathWithRoundedRect:[self collectionView].bounds cornerRadius:0.0f] CGPath]];

@justincbeck
Copy link
Author

I bet just ditching the shadow is what you need to do. For some reason I can't apply the shadow along the path like that... It's offset and looks weird. Give that a try and let's see how things are. If we need to, we can drop the shadows for 1.0 and then see if we can git things more performant in 1.1.

@justincbeck
Copy link
Author

I took another look at this. You have the shadow radius set to 100.0. That completely crushed the UI. I took it back to 1.0 and it's MUCH better. I'll get it checked in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment