Ios TableView页脚不随内容滚动
在我的应用程序中,我的tableview(tableview.tablefooterview)的页脚中有一个视图,它不随内容滚动 无论我做什么,它都会随着一个单元格的加入而被压下。 以下是初始化代码:Ios TableView页脚不随内容滚动,ios,uitableview,uikit,Ios,Uitableview,Uikit,在我的应用程序中,我的tableview(tableview.tablefooterview)的页脚中有一个视图,它不随内容滚动 无论我做什么,它都会随着一个单元格的加入而被压下。 以下是初始化代码: CGRect footerRect = CGRectMake(0, 0, 320, 200); footerview2.frame = footerRect; self.tableView.backgroundColor = self.footerview.backgroundColor;
CGRect footerRect = CGRectMake(0, 0, 320, 200);
footerview2.frame = footerRect;
self.tableView.backgroundColor = self.footerview.backgroundColor;
self.tableView.tableFooterView = footerview2;
尝试添加节页脚。实现tableview委托:
-(UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return footerview2;
}
尝试添加节页脚。实现tableview委托:
-(UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return footerview2;
}
在视图控制器中添加此方法
- (CGFloat) tableView : (UITableView *) tableView heightForFooterInSection : ( NSInteger ) section
在视图控制器中添加此方法
- (CGFloat) tableView : (UITableView *) tableView heightForFooterInSection : ( NSInteger ) section
表视图中有多少节?表视图中有多少节?