Skip to content

Instantly share code, notes, and snippets.

@funkyboy
Created August 10, 2012 15:32
Show Gist options
  • Save funkyboy/3315063 to your computer and use it in GitHub Desktop.
Save funkyboy/3315063 to your computer and use it in GitHub Desktop.
Tweak padding in UIToolbar
NSMutableArray *items = [[NSMutableArray alloc] init];
UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
negativeSpacer.width = -10;
[items addObject:negativeSpacer];
// add button here
// padding will be 10px less than default
[self.toolbar setItems:items animated:YES];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment