首页 > 代码库 > autolayout under navigation bar

autolayout under navigation bar

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的下侧了。

这里可以将topLayoutGuide当做一个UIView,在ios7中,就是让他与其他view平等了

autolayout under navigation bar