2015-06-25 56 views

回答

0

我不知道是否有这样做就像使用UITableViewAutomaticDimension除了使用自动布局约束的自动方式

你可以做的是创造一个约束属性

@property (nonatomic, strong) NSLayoutConstraint *heightConstraint; 

然后计算创建后的单元格内容大小以及updateConstraints更新高度约束常量

self.heightConstraint.constant = calculatedHeight; 

最后只要你有更新的内容调用setNeedsUpdateConstraints

相关问题