How to center two labels
问题 I have two buttons. I want both buttons on the same line horizontally and i want equal space on the left of the left button, between the two buttons, and on the right of the right button. I want to center two buttons like this: 回答1: If I were you, I would make them programmatically. This would work if they were contained in a view. The code below assumes you want to center the buttons in your viewController. To Make UIButtons Programmatically In ViewDidLoad: let myFirstXCoordinate = CGFloat(