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];
add this line
someLabel.adjustsFontSizeToFitWidth = YES;
精彩评论