删除 tableview 页脚行

Posted

技术标签:

【中文标题】删除 tableview 页脚行【英文标题】:Remove tableview footer line 【发布时间】:2014-09-30 17:35:10 【问题描述】:

我将图像背景设置为这样的表格视图:

[self.tableView setBackgroundColor:[UIColor clearColor]];
UIImageView *tableBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myImage"]];
[tableBackgroundView setFrame: self.tableView.frame];
[self.tableView setBackgroundView:tableBackgroundView];

如果我向下移动滚动条,它总是在末尾显示一条灰线。我试过了

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];

但它仍然无法正常工作。

【问题讨论】:

您是否关闭了分隔符?将分隔符样式设置为UITableViewCellSeparatorStyleNone @CrimsonChris 我更新了问题,我尝试了 UITableViewCellSeparatorStyleNone 但仍然无法正常工作。 【参考方案1】:

请在 viewDidLoad 中尝试以下行:

[self.tableView setTableFooterView:[[UIView alloc]initWithFrame:CGRectZero]];

这将从 tableview 中删除额外的分隔符

希望它会起作用......

【讨论】:

我就是这么做的。你也可以看到我的帖子。

以上是关于删除 tableview 页脚行的主要内容,如果未能解决你的问题,请参考以下文章

除非我滚动,否则页脚不会显示在 TableView 上

论坛类应用双Tableview翻页效果实现

设置页脚高度后tableView的contentSize不正确

如何在 TableView 的一个部分手动设置页脚(iOS)?

tableViews 中的搜索和复选标记

如何从单元格 tableView 转到下一页到 2 页