I need help setting the correct constraints for the table view below. Heres the code for the constraints.. I am trying to show a 60 by 60 image view with a text by the right; please have a look at Tvtable view cell file.
Project link: https://github.com/lexypaul13/Trending-Tv-Shows/
private func set() {
addSubview(tvImage)
addSubview(tvName)
tvImage.translatesAutoresizingMaskIntoConstraints = false
tvName.translatesAutoresizingMaskIntoConstraints = false
let padding: CGFloat = 12
NSLayoutConstraint.activate([
tvImage.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
tvImage.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: padding),
tvImage.heightAnchor.constraint(equalToConstant: 60),
tvImage.widthAnchor.constraint(equalToConstant: 60),
tvName.centerYAnchor.constraint(equalTo: self.centerYAnchor),
tvName.leadingAnchor.constraint(equalTo: tvImage.trailingAnchor, constant: 24),
tvImage.trailingAnchor.constraint(equalTo: self.trailingAnchor, constant: -padding),
tvImage.heightAnchor.constraint(equalToConstant: 40)])
}
question from:
https://stackoverflow.com/questions/65880238/how-do-i-set-the-correct-constraints-for-the-table-view-below 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…