Apollo
Apollo

Reputation: 9064

set uibutton text alignment storyboard

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?

Upvotes: 3

Views: 4580

Answers (3)

Erich Flock
Erich Flock

Reputation: 287

You can also adjust the constraints of the content, title or image in the size inspector of the button:

enter image description here

In my case, I was only able to really centralize the character "+" and "-" after setting a value for the bottom of the title.

Upvotes: 0

Kakahn
Kakahn

Reputation: 101

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

Upvotes: 5

Max Hudson
Max Hudson

Reputation: 10226

How to make UIButton's text alignment center? Using IB

This post shows how to do it in storyboard.

enter image description here

Upvotes: 4

Related Questions