openkava
2014-08-29 15:51:18 +08:00
UILabel *lbTeseTitle2 = [[UILabel alloc ] initWithFrame:CGRectMake(36, 24, titleView.width-40 ,50 )] ;
lbTeseTitle2.text = self.theItem[@"feature"] ;
lbTeseTitle2.font = SYSTEMFONT(14) ;
[lbTeseTitle2 setNumberOfLines: 0];
[tempView addSubview:lbTeseTitle2 ] ;
//设置一个行高上限
CGSize size = CGSizeMake(titleView.width-40,2000);
//计算实际frame大小,并将label的frame变成实际大小
CGSize labelsize = [ lbTeseTitle2.text sizeWithFont:lbTeseTitle2.font constrainedToSize:size lineBreakMode:NSLineBreakByWordWrapping];
[lbTeseTitle2 setFrame: CGRectMake(36, 24, labelsize.width, labelsize.height)];