You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like setResizeToFitText only applies when the frame you set at the beginning is smaller than the frame the actual label takes.
That means it won't resize the label to the text height when you start of with a height of 70.
@Tuszy Maybe this functionality needs better documentation. I think the logic behind the decision to only resize when the label was specified smaller than it needs to be makes sense.
Hi guys!
I can't make setResizeToFitText work.
I'm pasting in the code from the documentation, and that does not seem to work either.
What am I doing wrong?
Thanks,
Gon
MTLabel *label = [MTLabel labelWithFrame:CGRectMake(20, 150, 250, 70)
andText:@"Hello!"];
[label setTextAlignment:MTLabelTextAlignmentCenter];
[label setFont:[UIFont boldSystemFontOfSize:15]];
[label setFontColor:[UIColor blueColor]];
[label setLineHeight:20];
[label setResizeToFitText:YES];
[self.view addSubview:label];
The text was updated successfully, but these errors were encountered: