UITableView iOS 5顶部的灰色线

UITableView iOS 5顶部的灰色线,uitableview,ios5,three20,Uitableview,Ios5,Three20,在iOS 5中,我的UITableView顶部出现了一条奇怪的灰色线(在我升级到Xcode 4.3并在iOS 5 iPhone上运行应用程序之前,这条线从未出现过)-还有人看到过吗?我的其他一些TableViewController中也出现了有趣的白线,我通过这样做消除了这些白线: // needed to get rid of funny white lines in iOS 5 tableView.separatorStyle = UITableViewCellSeparat

在iOS 5中,我的UITableView顶部出现了一条奇怪的灰色线(在我升级到Xcode 4.3并在iOS 5 iPhone上运行应用程序之前,这条线从未出现过)-还有人看到过吗?我的其他一些TableViewController中也出现了有趣的白线,我通过这样做消除了这些白线:

    // needed to get rid of funny white lines in iOS 5
    tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
tableView.separatorColor = [UIColor clearColor]; 
但是,这无法删除该行。这里没有标题。该行使用我的UITableView上下滚动

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

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

我也有同样的问题,但只在编辑模式下出现。 我需要标题,所以前面的答案不适合我。 但这个答案对我有帮助 ,我希望它能帮助那些遇到同样问题的人

tableView.separatorColor = [UIColor clearColor]; 

如果您有一个简单的背景,使用
colorWithPatternImage
更改
colorWithRed:green:blue:alpha
即可

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

但是对于这样的背景,如果您可以以倾斜图像构成整个背景的方式裁剪background.png图像,将删除顶部的线条

尝试以下操作:tableView.separatorStyle=UITableViewCellSeparatorStyleNone;感谢您的快速响应-不幸的是,这没有起作用,线路仍然在那里