摘要: 下面代码示范了如何自动计算UILabel尺寸以适应文本的展示:NSString * myText = [NSString stringWithString:@"some text"];//获取到文本大大小CGFloat constrainedSize = 265.0f; //其他大小也行UIFont * myFont = [UIFont fontWithName:@"Arial" size:19]; // UILabel使用的字体CGSize textSize = [myText sizeWithFont: myFont constrainedToSiz 阅读全文
posted @ 2011-12-08 14:10 Gang.Wang 阅读(1639) 评论(0) 推荐(0) 编辑