Skip to content

Instantly share code, notes, and snippets.

@adamcooke
Last active September 24, 2016 11:22
Show Gist options
  • Select an option

  • Save adamcooke/a6ce87df015f26488fc1 to your computer and use it in GitHub Desktop.

Select an option

Save adamcooke/a6ce87df015f26488fc1 to your computer and use it in GitHub Desktop.
// Create a new layer which is the width of the device and with a heigh
// of 0.5px.
CALayer *topBorder = [CALayer layer];
topBorder.frame = CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 0.5f);
// Set the background colour of the new layer to the colour you wish to
// use for the border.
topBorder.backgroundColor = [[UIColor blueColor] CGColor];
// Add the later to the tab bar's existing layer
[self.tabBar.layer addSublayer:topBorder];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment