UITableViewCell计算行高

http://www.cocoachina.com/bbs/simple/?t31769.html 

 

UITableViewCell *cell = [self tableView:tableView cellForRowAtIndexPath:indexPath];
    UILabel *tempLable=(UILabel *)[cell viewWithTag:1];
    UIImageView *tempImage=(UIImageView *)[cell viewWithTag:2];
    CGFloat lableHeight=tempLable.frame.size.height;
    CGFloat imageheight=tempImage.frame.size.height;
    if(lableHeight>imageheight)
        return lableHeight;
    else
        return imageheight;

 

posted @ 2013-10-16 17:06  时光独白  阅读(159)  评论(0编辑  收藏  举报