首页 > 其他 > 详细

tableviewcell 中使用autolayout自适应高度

时间:2015-02-06 18:35:09      阅读:334      评论:0      收藏:0      [点我收藏+]
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
[cell setNeedsUpdateConstraints];
[cell updateConstraintsIfNeeded];
  CGSize size = [self.prototypeCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
  return size.height+1;
}

  • Return the height of the cell remembering to add 1 point for the cell separator.
 

tableviewcell 中使用autolayout自适应高度

原文:http://www.cnblogs.com/zj901203/p/4277562.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!