Have a few UIButtons (perhaps in a stack view), left align, and each with an image.
When you set the content inset left (4 in the example), the minX of the text (the "S" in the example) varies depending on the image width
In almost all cases, your designer is gonna want all the texts to align with each other left.
Is there some setting to align the texts "independently" ? Say, set the contentInset of the text separately from the image, or make the images a fixed width (they’d sit left within that width).
Obviously one could write a completely custom button, add the image yourself, but it seems incredible to have to do so for such a common need?
2
Answers
My life has been changed forever.
That’s what the configuration’s
imageReservation
property is for.It specifies how much room is to be set aside for image. If all the buttons have the same
imageReservation
value, the image section of all the buttons will be the same width.