I need to expand a series of buttons horizontally across the screen so that they are evenly distributed across the screen, unevenly distributed among themselves. The example consists of 3 buttons, they are evenly distributed so that the first button is centered on 25% of the screen width, and the others - 50%, 75% of the screen width.
It is relatively simple by manually placing them at the x, y coordinates, but I try to avoid mixing approaches.
The predominant recommendation is to use UIView between the buttons and set a limit so that the spacers are equal. This does not work if the spaced buttons have different sizes. Say there are 3 buttons labeled "A", "B", "ReallyLong." I still want them to be focused, and βBβ in the middle of the screen. Equal spacers leave an equal distance between them, but not evenly distributed buttons. ReallyLong takes up too much space, and B is not centered.

David source
share