Skip to content

Instantly share code, notes, and snippets.

@jeffbailey
Created February 17, 2014 17:50
Show Gist options
  • Save jeffbailey/9055516 to your computer and use it in GitHub Desktop.
Save jeffbailey/9055516 to your computer and use it in GitHub Desktop.
Depending on your background it may be necessary mask the background of a UISegmentedControl in iOS 7.
CAShapeLayer* mask = [[CAShapeLayer alloc] init];
mask.frame = CGRectMake(0, 0, segmentedControl.bounds.size.width-1, segmentedControl.bounds.size.height);
mask.path = [[UIBezierPath bezierPathWithRoundedRect:mask.frame cornerRadius:4] CGPath];
segmentedControl.layer.mask = mask;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment