我试图让我的 UITableViewCell 看起来像这样:
我决定添加一个 UIView 来包含我的文本,以便我可以制作边框。这是我的 .xib 配置
我的 ViewController 的 TableView 设置
tableView.delegate = self
tableView.dataSource = self
self.tableView.rowHeight = UITableView.automaticDimension
self.tableView.estimatedRowHeight = 100
if #available(iOS 15.0, *) {
tableView.sectionHeaderTopPadding = 0.0
}
self.tableView.isScrollEnabled = false
但是事情却变成了这样
与我的约束设置有关吗?或者我遗漏了什么,有人可以指出吗? 预先感谢