我有一個視圖的高度出口。它被設置爲55.在我使用過的tableview中。有些地方我需要靜態高度,有些地方不需要高度。所以我想從我的代碼中移除這個靜態高度。我可以如何實現這一目標?有可能嗎?Swift:我如何從代碼中刪除插座?
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)
}
}
即使我已設置活躍爲false,仍呈現靜態高度constraint.Can我刪除,在其他情況下,靜態的高度?
'ViewHeight.constant = 65 // StaticValue'這樣做。 –
我知道嗎?我在問我如何刪除這個約束,以便它不適用於其他條件。 –
欲瞭解更多的問題,你可以告訴我你的屏幕圖像。 –