2012-07-05 49 views
1

的backgound形象这里是我的我的应用程序UITableViewCell中删除每行之间的白色和显示的UIView

My app image

的形象,你可以看到,在每行中白线。我怎样才能摆脱这个界限?

这里是我的单元代码,我已经做了

cell.backgroundView = [ [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"conta.png"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ]autorelease]; 
cell.textLabel.backgroundColor=[UIColor clearColor]; 
cell.textLabel.text = [tableArray objectAtIndex:indexPath.row]; 
cell.selectionStyle = UITableViewCellSelectionStyleNone; 
tableView.backgroundColor=[UIColor clearColor]; 
return cell; 

我需要消灭每行中的白线。我怎样才能做到这一点?

回答

1

在XIBü可以选择分隔符样式是none.t![在这里输入的形象描述] [1]他使得白线不显示

cell.backgroundView = [ [[UIImageView alloc] initWithImage:[ [UIImage imageNamed:@"conta.png"] stretchableImageWithLeftCapWidth:0.0 topCapHeight:5.0] ]autorelease]; 
cell.textLabel.backgroundColor=[UIColor clearColor]; 
cell.textLabel.text = [tableArray objectAtIndex:indexPath.row]; 
cell.selectionStyle = UITableViewCellSelectionStyleNone; 
tableView.backgroundColor=[UIColor clearColor]; 
    return cell; 
7

在设置表格视图的过程中,您可以将分隔符样式设置为“无”。这是可以做到无论是在界面生成器情节提要/笔尖,也可以在代码中的东西,如来完成:

[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; 
1

您可以使用下面这样的代码,

self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 
self.tableView.separatorColor = [UIColor clearColor]; 
1

有时在小区个子不够高,因为你所做的细胞较小,但您forg OT设置它放在桌子上或在

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; 

还是因为你想离开细胞之间的一个小空间,这样的背景可以在它们之间可以看到较小的,你实际看到的是什么的“白色”表本身。

请记住,默认情况下,UITableViews为纯白色,所以如果您希望在单元格之间看到背景,则还需要将表格设置为“非不透明”,并将其背景颜色设置为清晰的颜色。

相关问题