Reputation: 419
I'm trying to use dynamic font size on a UIButton. But if I increase the font size, the text on the button gets truncated to "...".
UIButton
Any idea on how to fix this? Thanks 🙂
Upvotes: 1
Views: 1949
Reputation: 18368
You can get the UILabel of UIButton by
let btn = UIButton() .... if let label = btn.textLabel { label.adjustsFontSizeToFitWidth = true // Adjust font size automatically label.minimumScaleFactor = 0.5 //< The minimum font size scale factor }
Upvotes: 3
Use a constraint with height greater than or equal
Upvotes: 0