我在iOS 8的Xcode 6.4中的故事板中创建了一个UITableView自定义单元。当我在Storyboard的Size Inspector enter image description here中更改行高时,App中我的UITableView的自定义单元格没有任何变化。
答案 0 :(得分:5)
您可以在TableViewController
:
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 55
}
答案 1 :(得分:0)
在tableview控制器的这个方法中:
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath?) -> UITableViewCell?
确保添加以下行:
cell.height = yourHeight
答案 2 :(得分:0)
您可以在故事板上的表格视图中添加表视图单元格原型并拖动原型单元格底部,您可以获得高度单元格所需的内容。