Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sdpjswl/d57a3b1244afadf4750b to your computer and use it in GitHub Desktop.
Save sdpjswl/d57a3b1244afadf4750b to your computer and use it in GitHub Desktop.
- (void)centerButtonAndImageWithSpacing:(CGFloat)spacing {
CGFloat insetAmount = spacing / 2.0;
self.imageEdgeInsets = UIEdgeInsetsMake(0, -insetAmount, 0, insetAmount);
self.titleEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, -insetAmount);
self.contentEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, insetAmount);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment