码迷,mamicode.com
首页 > 其他好文 > 详细

可视化编程中----cell的自适应高度

时间:2015-03-31 14:35:54      阅读:97      评论:0      收藏:0      [点我收藏+]

标签:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

Joke *joke = self.dataArray[indexPath.row];


NSString *content = joke.joke;

self.customCell.contentLabel.text = content;
self.customCell.bounds = CGRectMake(0, 0, self.view.frame.size.width, self.customCell.frame.size.height);

[self.customCell updateConstraintsIfNeeded];
[self.customCell layoutIfNeeded];
CGFloat height = [self.customCell systemLayoutSizeFittingSize: UILayoutFittingCompressedSize].height + 1;
return height;

}

可视化编程中----cell的自适应高度

标签:

原文地址:http://www.cnblogs.com/shenhongbang/p/4380618.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!