IOS8之后 如果使用自动布局,就不用再需要手动计算UITableViewCell高度
注意事项:
1.Cell高度设置自动适配,预设高度
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 134.f;
2.在重用Cell的方法中实现,不要在layoutSubviews方法里面设置布局。
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
//在这里实现布局
[self mas_makeConstraints];
}