Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @implementation UIButton (Style)
- const CGFloat kImageTopOffset = -15;
- //const CGFloat kTextBottomOffset = -30;
- - (void)centerButtonImageTopAndTextBottomWithOffset:(CGFloat)bottomOffset
- {
- [self setTitleEdgeInsets:UIEdgeInsetsMake(0.0, -self.imageView.image.size.width, -bottomOffset, 0.0)];
- [self setImageEdgeInsets:UIEdgeInsetsMake(kImageTopOffset, 0.0, 0.0, -self.titleLabel.bounds.size.width)];
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement