在iOS6中使用NSLayoutConstraints创建UITableView';是否粘贴到最后一节的底部和UIScrollView的底部?

在iOS6中使用NSLayoutConstraints创建UITableView';是否粘贴到最后一节的底部和UIScrollView的底部?,uitableview,uiscrollview,table-footer,nslayoutconstraint,Uitableview,Uiscrollview,Table Footer,Nslayoutconstraint,在Interface Builder中,当使用UITableViewController的表页脚视图(我在其中添加了一个空白视图)时,似乎无法直接向其添加约束 当我选择表的页脚视图,然后选择一个约束时,所有约束都会灰显。这是一个bug还是(更有可能)我错误地认为您不能将表尾视图约束到UIScrollView -----编辑----- 此外,我还尝试在代码中添加此项 [self.tableView.tableFooterView setTranslatesAutoresizingMaskIntoC

在Interface Builder中,当使用
UITableViewController
的表页脚视图(我在其中添加了一个空白视图)时,似乎无法直接向其添加约束

当我选择表的页脚视图,然后选择一个约束时,所有约束都会灰显。这是一个bug还是(更有可能)我错误地认为您不能将表尾视图约束到
UIScrollView

-----编辑-----

此外,我还尝试在代码中添加此项

[self.tableView.tableFooterView setTranslatesAutoresizingMaskIntoConstraints:NO];

//      Setup constraints
//
NSDictionary *viewsDictionary = @{@"superView" : self.view, @"tableView" : self.tableView,  @"tableFooterView" : self.tableView.tableFooterView};

//          Footer
//
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[tableFooterView]|"
                                                                                       options:0
                                                                                       metrics:nil
                                                                                         views:viewsDictionary]];
但我只是在输出中得到这个:

2012-10-10 16:29:04.606 myApp[632:c07] *** Assertion failure in -[UITableView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2372/UIView.m:5776
2012-10-10 16:29:04.608 myApp[632:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.'
*** First throw call stack:
(0x199b012 0x17c0e7e 0x199ae78 0x1256f35 0x7589ef 0x17d46b0 0x622fc0 0x61733c 0x622eaf 0x7f78cd 0x7401a6 0x73ecbf 0x73ebd9 0x73de34 0x73dc6e 0x73ea29 0x741922 0x7ebfec 0x738bc4 0x738dbf 0x738f55 0x741f67 0x705fcc 0x706fab 0x718315 0x71924b 0x70acf8 0x27e8df9 0x27e8ad0 0x1910bf5 0x1910962 0x1941bb6 0x1940f44 0x1940e1b 0x7067da 0x70865c 0x6d4d 0x2615)
libc++abi.dylib: terminate called throwing an exception
我也得到了同样的结果,但在你的情况下,试着 温度修正: 禁用自定义单元Xib中的自动布局,然后生成