【发布时间】:2016-05-09 10:30:53
【问题描述】:
一张图片说明一千个单词,所以这是我的 UITableViewCell 的图像,带有我的约束。
我有一个固定到内容视图所有边缘的视图,内部还有另一个固定宽度和高度的视图,固定在超级视图的底部和顶部。我试图将这个视图的 x 轴居中到它的超级视图。在设备上运行一切看起来都很好,但是界面生成器在外部视图上抛出了一个错误,说它需要 Y 位置或高度的约束。我可以在界面生成器中以某种方式绕过它吗?还是我错过了一些关于自我调整表格单元格的基本知识?
我正在调整表格单元格的大小:
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
【问题讨论】:
标签: ios xcode swift uitableview