Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
- (void)setupVerticalImageTitleAlignmentFor:(UIButton *)button {
button.titleEdgeInsets = UIEdgeInsetsMake(0, -buttonImageSize, -buttonImageSize, 0);
[button.titleLabel sizeToFit];
CGFloat titleWidth = button.titleLabel.frame.size.width;
button.imageEdgeInsets = UIEdgeInsetsMake(-buttonTitleHeight, 0, 0, -titleWidth);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.