The iOS 9.0 comes with UIStackView which makes it easier to layout views according to their content size. For example, to place 3 buttons in a row in accordance with their content width you can simply embed them in stack view, set axis horizontal and distribution - fill proportionally.

[![Stack View Solution](https://i.stack.imgur.com/QymoE.png)](https://i.stack.imgur.com/QymoE.png)

The question is how to achieve the same result in older iOS versions where stack view is not supported.

One solution I came up with is rough and doesn't look good. Again, You place 3 buttons in a row and pin them to nearest neighbors using constraints. After doing that you obviously will see content priority ambiguity error because auto layout system has no idea which button needs to grow / shrink before others. 

[![Content Priority Ambiguity](https://i.stack.imgur.com/9sqNr.png)](https://i.stack.imgur.com/9sqNr.png)

Unfortunately, the titles are unknown before app's launch so you just might arbitrary pick a button. Let's say, I've decreased horizontal content hugging priority of middle button from standard 250 to 249. Now it'll grow before other two. Another problem is that left and right buttons strictly shrink to their content width without any nice looking paddings as in Stack View version.

[![Layout Comparsion](https://i.stack.imgur.com/eep59.png)](https://i.stack.imgur.com/eep59.png)