天天看点

计算UITableViewcell高度

+(CGFloat)cellHeightWithModel:(id)model {

    ZHNewsTableViewCell *cell = [[ZHNewsTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@""];

    [cell setModel:model];

    [cell layoutIfNeeded];

    CGRect frame =  cell.backGroundView.frame;

    CGFloat height = frame.origin.y + frame.size.height + kBaseInterval;

    return height;

}