step1
tableV.estimatedRowHeight = 100
tableV.rowHeight = UITableViewAutomaticDimension
step2
在cell里设置
func setConstraint() {
stackView.translatesAutoresizingMaskIntoConstraints = false // 最好加上
stackView.topAnchor.constraint(equalTo: self.contentView.topAnchor).isActive = true
stackView.bottomAnchor.constraint(equalTo: self.contentView.bottomAnchor, constant: -25).isActive = true
}