UIView *topLayoutGuide = self.topLayoutGuide; NSDictionary *viewsDictionary = NSDictionaryOfVariableBindings(selectBuuton, itemTableView, itemCollection, topLayoutGuide); constraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topLayoutGuide]-[selectBuuton]-[itemTableView]" options:0 metrics:nil views:viewsDictionary]; [self.view addConstraints:constraints];
這樣就能夠用VFL去實現view們顯示在navigationbar的下側了。ios
這裏能夠將topLayoutGuide當作一個UIView,在ios7中,就是讓他與其餘view平等了ide