文字调整为适合代码?

时间:2011-03-25 07:09:10

标签: iphone xcode text uilabel

在Xcode中动态创建的UILabel文本是否有相应的Adjust to Fit? 即:

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

1 个答案:

答案 0 :(得分:2)

添加此行

someLabel.adjustsFontSizeToFitWidth = YES;