不需要的表格单元格显示 [英] Unwanted Tablecells showing

查看:55
本文介绍了不需要的表格单元格显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试删除这些我不使用但不知道如何使用的表格单元.我已经指定了我想要多少个单元格,但是这些不需要的单元格一直在显示,就像这样;

I am trying to remove these tablecells which I am not using but don't know how. I already specified how many cells I want but these unwanted one keep showing, like so;

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
 return 3;
}

有人知道如何解决这个问题吗?预先感谢

anyone know how to solve this? thanks in advance

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
if ([self numberOfSectionsInTableView:tableView] == (section+1))
{
    return [UIView new];
}
return nil;

但无济于事,因为我收到了sigabrt错误.为什么呢?

but to no avail as i get a sigabrt error..why is that ?

推荐答案

我个人使用以下方法解决了该问题:

I personally solved it using :

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.1;
}

代替 viewForFooterInSection:.

这篇关于不需要的表格单元格显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆