1、Storyboard里面添加一下cell,并拖好控件
2、在UITableViewDelegate里面把cell加载进去
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return [tableView dequeueReusableCellWithIdentifier:@"FooterCell"];
}
3、设置footer的高
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 50;
}
这个是对section来说的footer。对tableView的footer,大家google 一下吧
2、在UITableViewDelegate里面把cell加载进去
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return [tableView dequeueReusableCellWithIdentifier:@"FooterCell"];
}
3、设置footer的高
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 50;
}
这个是对section来说的footer。对tableView的footer,大家google 一下吧
其实还有一种方法是在storyboard 中,在tableview 的footview上拖一个空的view ,然后再在view 放你想要放的控件 (button 啊什么的)注意的是 view的尺寸一般要比你要放的控件大