Lauren Quantrell
Lauren Quantrell

Reputation: 2669

Text Adjust to Fit in code?

Is there an equivalent of Adjust to Fit for UILabel text created dynamically in Xcode? ie:

UILabel *someLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 35, 18)];                                   
someLabel.font = [UIFont boldSystemFontOfSize:14];
someLabel.FOO_SIZETOFIT = YES; //FOO CODE
[someLabel release];

Upvotes: 1

Views: 1110

Answers (1)

Vaibhav Tekam
Vaibhav Tekam

Reputation: 2344

add this line

someLabel.adjustsFontSizeToFitWidth = YES;

Upvotes: 2

Related Questions