In my app, I have a view in the footer of my tableview (tableview.tablefooterview) that doesn't scroll with the content. crappy

No matter what I do, it gets pushed down with the addition of a cell. Here is the initialization code:

  CGRect footerRect = CGRectMake(0, 0, 320, 200);
footerview2.frame = footerRect;

self.tableView.backgroundColor = self.footerview.backgroundColor;
self.tableView.tableFooterView = footerview2;
有帮助吗?

解决方案

Try adding section footer. Implement the tableview delegate:

-(UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return footerview2;
}

其他提示

add this method in you view controller

- (CGFloat) tableView : (UITableView  *) tableView heightForFooterInSection : ( NSInteger ) section
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top