Hey,
I need the text that is set as the title to a UIButton to automatically shrink/enlarge to fit the button area (like adjustsFontSizeToFitWidth does for UILabel). I notice that the text view on a UIButton is a UILabel, but it is private so I can't subclass it/change it to enable this property.
What's the best way to go about achieving this? At the minute all I can think of is to subclass the UIButton, make a new UILabel instance variable and override all methods that interact with the default UIButton text view...
I guess I could also just have a UILabel sit on top of a UIButton and set the text of the UILabel directly instead of the button, but that seems like a bit of a dodgy workaround...
Thanks for your time,
-Ross
I need the text that is set as the title to a UIButton to automatically shrink/enlarge to fit the button area (like adjustsFontSizeToFitWidth does for UILabel). I notice that the text view on a UIButton is a UILabel, but it is private so I can't subclass it/change it to enable this property.
What's the best way to go about achieving this? At the minute all I can think of is to subclass the UIButton, make a new UILabel instance variable and override all methods that interact with the default UIButton text view...
I guess I could also just have a UILabel sit on top of a UIButton and set the text of the UILabel directly instead of the button, but that seems like a bit of a dodgy workaround...
Thanks for your time,
-Ross