0
我有以下限制:iOS的自動版式視覺格式的語言翻譯
[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[drawerView(==tapView)]|" options:0 metrics:nil views:viewDictionary]
我想要做一些動畫吧,所以我需要把它參數化。我想擁有同樣的東西,但使用API。這是我試過,但它不起作用:
[NSLayoutConstraint constraintWithItem:drawerView
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:self.drawerMenuVC.tapView
attribute:NSLayoutAttributeHeight
multiplier:1.0
constant:0]
我想要的是兩個視圖都有相同的高度。
什麼是「不工作」是什麼意思?你有沒有把這個約束添加到這兩個視圖的超級視圖? – rdelmar 2014-11-04 16:14:51
是的,只是沒有任何反應。 – Petar 2014-11-04 16:17:50
您還需要對其中一個視圖進行高度約束。 – 2014-11-04 16:23:27