Reputation: 205
Using Xcode's storyboard
, how can I add padding to the left and right of a UIButton's
text? I can't for the life of me figure out how to do this.
Here is my button:
I want the button to "hug" the text and then give padding of 32px
on the left and right sides of the button.
But when I try to add a Title Inset
, it just squeezes the text to a point where it's almost not showing:
So how do I adjust the button's padding properly?
Upvotes: 0
Views: 1892
Reputation: 1946
Ensure following things are done for the Button in storyboard.
Content insets
value for Left and Right as 32px
in Size
Inspector
in storyboard.Content Compression Resistance priority
-
Horizontal
value is high (751) for safer side.I have tested this. It's working for me.
Upvotes: 4