4

I have 3 UIButtons in a row. I'm even being good and using a UIStackView.

When I localised; one of the three labels exceeded my bounds. So, to compensate; I kicked in Autoshrink.

    buttons = [receivedButton, usedButton, sentButton]

    _ = buttons.map {button in
        button.titleLabel?.adjustsFontSizeToFitWidth = true
        button.titleLabel?.minimumScaleFactor = 0.5
    }

Now the problem I have is that when one is too long it autoshrinks but the other two don't. Is there anyway for me to "willAutoShrinkTo:" on the elements so that if one shrinks, I can make sure they all adjust to the minimum font size.

This way I don't wind up with "Long in 15pt" "16 pt" "16 pt" which looks horrid.

Dru Freeman
  • 1,766
  • 3
  • 19
  • 41
  • Related: https://stackoverflow.com/questions/19195541/how-to-calculate-actual-font-point-size-in-ios-7-not-the-bounding-rectangle – jrturton Jul 05 '17 at 18:38

0 Answers0