UITableView底部分隔符插入 – IOS 7中的奇怪行为

我的应用程序包含一个UITableView,它有部分页脚.当用户滚动到tableView的底部时,有时在最后一个单元格和tableFooter之间会出现分隔符插入.此行为不一致.

有没有办法强制此分隔符始终显示或永远不会出现?你们有没有注意到这种不一致的行为?对我来说似乎是个错误.

编辑
我正在使用

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UILabel *footer = [[UILabel alloc] init];

    footer.backgroundColor = [UIColor whiteColor];

    footer.font = [footer.font fontWithSize:15];
    footer.textAlignment = NSTextAlignmentCenter;

    return footer;
}

但你只能使用它轻松重现同样的问题

- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section;

解决方法

为此,您必须覆盖用作页脚的标准UIView.

您可以通过覆盖委托方法 – (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)部分来完成此操作.

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *myFooterView;

    // create a view with a label and without a line at the top etc...

    return myFooterView;
}

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...