【发布时间】:2017-08-01 00:30:09
【问题描述】:
我在 tableview 上有一个 webview,在每个单元格上,我在电话号码和电子邮件/网站地址之后都有一些额外的空白。那么如何从单元格中删除/删除多余的空白空间以使其看起来更好。
我的代码是这样的:
self.heightOfTheCell = CGFloat(((heightMul)*32)+4)
我不太清楚如何处理这些数字。
请查看随附的屏幕截图。
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0
{
if heightOfTheCell != nil
{
return heightOfTheCell
}else{
return UITableViewAutomaticDimension
}
}
else{
return UITableViewAutomaticDimension
}
}
func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableViewAutomaticDimension
}
【问题讨论】:
标签: uitableview swift3 uiwebview autolayout