我有一个UITableViewController
与底部的UIView
。 (使用故事板)。我的UIView
设置为隐藏,然后通过单击按钮更改状态。首先,我试图使用self.concluidoView.frame = CGRectMake(0, 0, 320, 50);
来调整IBAction
(buttonClick)上UIView的大小(基本上增加高度),但是UIView正在消失。现在UITableView扩展子视图后不够滚动
,它正确地用下面的代码里面IBAction
扩大UIView
:
[UIView animateWithDuration:1.0
animations:^{
CGRect frame = self.concluidoView.frame;
frame.size.height += 100.0;
self.concluidoView.frame = frame;
}
completion:^(BOOL finished){
// complete
}];
的问题是,我的UITableViewController没有滚动足够的新的大小,因为UIView
是我tableView
的最后一个项目。
我已经尝试了几件事情来解决这个问题,包括手动尝试调整tableview
以将其高度增加到UIView
增加的相同值。我用下面的代码:
CGRect tableFrame = self.tableview.frame;
tableFrame.size.height += 100;
self.tableView.frame = tableFrame;
[self.tableview layoutIfNeeded];
我tableview
的滚动能力为这个代码后实际更小。我想调整tableview
并允许手动滚动,因为我知道我的subview
会增加多少或自动增加。
完美!这样做的工作,我有我的'UIView'在'@属性',所以我只是'tableFooterView'分配给它。谢谢。 – Jorge