I found a solution on how to set the minimum font size to fit the width of my button:
button.titleLabel.numberOfLines = 1; button.titleLabel.adjustsFontSizeToFitWidth = YES; button.titleLabel.lineBreakMode = NSLineBreakByClipping;
But how to add margin left and right.
Thus, the width of the button label is 200 pt the same as the width of the button. I need my title label to be with spaces on the right and left, so this means that the label width should be, for example, 180 dots, and then I will have 10pt on the right and left.
How can i achieve this?
source share