在清除表的选定单元格之间出现黑色1px线

时间:2014-04-11 12:40:59

标签: ios uitableview

在Xcode 5.1之前,这个问题对我来说并不存在,但现在用5.1 / 5.1.1构建我的应用程序时我看到选择了我的表格单元格后会出现黑色水平线条。表视图和单元格都有清晰的背景,代码从工作正常的时候没有任何变化。

viewDidLoad方法中,我设置了以下tableView参数:

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.tableView.backgroundColor = [UIColor clearColor];
self.view.backgroundColor = [UIColor clearColor];

cellForRowAtIndexPath方法中:

ListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ListViewCell"];

if (cell == nil) {
    cell = [[ListViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ListViewCell"];
}

return cell;

}

我使用的UITableViewCell子类在awakeFromNib中有以下内容:

UIView *bkgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height)];
bkgView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
bkgView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f];
self.selectedBackgroundView = bkgView;

当在Xcode版本中构建时,此代码工作正常。 5.1但现在我看到了不同的结果。与Plain和Grouped样式一起发生。

1 个答案:

答案 0 :(得分:0)

   [self.tableView setSeparatorColor:[UIColor clearColor]];
相关问题