我已经为表格视图中的单元格设置了图像,但没有显示分隔单元格的线条。我做错了什么?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *mbTableIdentifier = @"SimpleTableItem";
UIImageView *image = [[UIImageView alloc]init];
image.image = [UIImage imageNamed:@"BarButton.png"];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:mbTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:mbTableIdentifier];
cell.textLabel.font=[UIFont systemFontOfSize:16.0];
}
// cell.backgroundView = [[CustomCellBackground alloc] init];
cell.selectedBackgroundView = [[CustomCellBackground alloc] init];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.textLabel.highlightedTextColor = [UIColor darkGrayColor];
cell.textLabel.textColor = [UIColor whiteColor];
cell.backgroundView = image;
cell.textLabel.text = [mbTableData objectAtIndex:indexPath.row];
return cell;
}
编辑:我已经记录了我的分隔符样式和颜色
2013-05-20 07:28:40.392 KFBNewsroom[1274:c07] 单元格分隔符样式:2 分隔符颜色:UIDeviceRGBColorSpace 0.67 0.67 0.67 1 2013-05-20 07:28:40.393 KFBNewsroom[1274:c07] 单元格分隔符样式:2分隔符颜色:UIDeviceRGBColorSpace 0.67 0.67 0.67 1 2013-05-20 07:28:40.393 KFBNewsroom[1274:c07] 单元格分隔符样式:2 分隔符颜色:UIDeviceRGBColorSpace 0.67 0.67 0.67 1
编辑:问题的截图
编辑:我最终通过在图像底部添加一条 1 像素线来解决问题。