-2

Seems to be missing so I can no longer do

How to alignment the text of button to the left?

I can modify the frame but that doesn't work either.

quantumpotato
  • 9,168
  • 12
  • 64
  • 140

2 Answers2

1

Use this code:

yourButton.contentHorizontalAlignment = .left; //For horizontal alignment (.center, .left, .right, .fill)
yourButton.contentVerticalAlignment = .center; //For vertical alignment (.bottom, .center, .fill, .top)

Also you can set control alignment in the IB.

D1mers0n
  • 420
  • 6
  • 9
0

You can do this in IB also. Go in attribute inspector of UIButton set Control

enter image description here

Hitesh Agarwal
  • 1,883
  • 16
  • 20