UITableView上的灰线iOS 5

问题描述:

iOS 5中我的UITableView顶部出现了一条奇怪的灰线(直到我升级到Xcode 4.3并且在iOS 5 iPhone上运行应用程序时才出现) - 还有其他人看过这个?我也越来越搞笑的白线在一些我被这样摆脱我的其他TableViewControllers的:UITableView上的灰线iOS 5

// needed to get rid of funny white lines in iOS 5 
    tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; 
tableView.separatorColor = [UIColor clearColor]; 

然而,这并不工作,删除此行。这里没有标题标题。该行与我的UITableView上下滚动 settings

+0

试试这个: tableView.separatorStyle = UITableViewCellSeparatorStyleNone; – iMash 2012-04-24 14:01:26

+0

感谢您的快速反应 - 不幸的是,没有工作,线路仍然存在 – 2012-04-24 14:05:49

您可能正在实现heightForHeaderInSection方法。 或者完全删除或返回0

-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 
{ 
    return 0.0; 
} 

我有同样的问题,但只出现在编辑模式。 我需要标题,所以以前的答案不适合我。 但是,这个答案对我有帮助Remove top gray line on UITableViewCell ,我希望它可以帮助一个人,遇到同样的问题。

tableView.separatorColor = [UIColor clearColor]; 

如果你有一个简单的背景改变colorWithPatternImagecolorWithRed:green:blue:alpha会做的伎俩。

//self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background"]]; 
self.tableView.backgroundColor = [UIColor colorWithRed: green: blue: alpha:] 

但对于这样的背景下,如果你能以一种倾斜的图像组成整个背景裁剪background.png图像,将删除在上面就行了。