Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UIImage *image = [UIImage new]; // your button icon image
- self.button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
- [self.button setImage:image forState:UIControlStateNormal];
- [self.button setImage:image forState:UIControlStateHighlighted];
- self.button.imageEdgeInsets = UIEdgeInsetsMake(0, self.button.frame.size.width - image.size.width, 0, 0);
- self.button.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, image.size.width);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement