I know that in code I can do [myButton.titleLabel setTextAlignment: NSTextAlignmentRight];
but how would I do this in Storyboard in User Defined Runtime Attributes?
Asked
Active
Viewed 4,144 times
3

Apollo
- 8,874
- 32
- 104
- 192
3 Answers
5
You can set the alignment of content (text or image) within your UIButton in the Attributes Inspector Panel.
The menu is "Control", you can set Horizontal & Vertical Alignment

Sumner Evans
- 8,951
- 5
- 30
- 47

Kakahn
- 101
- 6
-
1How to set padding with that? I mean when i did this, the button text just sticks to the left of its view with no padding and that looks odd. – zulkarnain shah Oct 21 '17 at 07:14
0
You can also adjust the constraints of the content, title or image in the size inspector of the button:
In my case, I was only able to really centralize the character "+" and "-" after setting a value for the bottom of the title.

Erich Flock
- 227
- 3
- 6