Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoshrink setting for UIButton in Storyboard

There is a setting for UILabel in storyboard that allows setting auto-shrink configurations, as shown below:

enter image description here

But I am unable to find the same for UIButton's textlabel. I am aware that I can set this programmatically but curious to know if there's a way to enable this setting for UIButton in Storyboard.

like image 479
Evol Gate Avatar asked Mar 08 '16 06:03

Evol Gate


1 Answers

You can use User Defined Runtime Attributes to set this flag using the storyboard.

Set the following key path:

titleLabel.adjustsFontSizeToFitWidth to true 

Adjust Font Size using Storyboard

like image 104
Nicholas Avatar answered Oct 21 '22 16:10

Nicholas