2014-09-30 61 views
1

我设置图像背景的实现代码如下所示:删除的tableview页脚行

[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]; 

但它仍然没有工作。

enter image description here

+0

你关掉分离?将分隔符样式设置为“UITableViewCellSeparatorStyleNone”。 – CrimsonChris 2014-09-30 17:40:09

+0

@CrimsonChris我更新了这个问题,我尝试了UITableViewCellSeparatorStyleNone但仍然无法正常工作。 – angelokh 2014-09-30 21:57:13

回答

0

请尝试在viewDidLoad中下面的行:

[self.tableView setTableFooterView:[[UIView的页头] initWithFrame:方法CGRectZero]];

这将实现代码如下

希望它会工作除去多余的分隔符...

+0

这就是我所做的。你也可以看到我的帖子。 – angelokh 2014-10-01 22:27:11