【发布时间】:2017-10-05 05:25:05
【问题描述】:
我有一个观景高度出口。它设置为 55。在 tableview 中我使用过它。有些地方我需要静态高度,有些地方不需要高度。所以我想从我的代码中删除这个静态高度。我怎样才能做到这一点?有可能吗?
func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
if(heightIsStatic.count> 0)
{
//here i require a static height and is working fine as height can
//be printed as 55
}
else
{
self.ViewHeight.active = false
print(self.ViewHeight.constant)
}
}
即使我已将 active 设置为 false,它仍然显示静态高度限制。在其他情况下我可以删除该静态高度吗??
【问题讨论】:
-
ViewHeight.constant = 65 //StaticValue这样做。 -
我知道吗?我在问如何删除此约束,使其不适用于其他条件。
-
要了解更多问题,您可以给我看一下您的屏幕图像吗?
-
如果你不想要高度,那么在其他条件下使用
ViewHeight.constant = 0, -
即使在其他情况下高度仍然显示 55。这就是我的全部问题,我想以任何方式将其删除。
标签: ios uitableview swift2