2010-12-22 18 views
0

我想要一个没有浮动页眉和页脚,但在UITableViewStylePlain风格的tableview。当我使用分组样式tableview时,它会在我的单元格周围绘制这个圆角矩形,并且它很烦人!有没有关闭这个设置?如何使tableview分组风格不缩进单元

我已经试过

tableView.backgroundView = nil; 
tableView.separatorStyle = UITableViewCellSeparatorStyleNone; 
tableView.autoresizingMask = UIViewAutoresizingNone; 

所有不起作用。有没有人有任何想法如何做到这一点?谢谢

+0

有没有一个解决方案?我有类似的问题。 – Roberto 2011-04-11 17:54:14

回答

0

尝试更改单元格背景颜色。你看到的白色圆角矩形是单元格的结果 - 而不是tableView(有点令人困惑)。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 
    // Standard Cell Setup in cellForRowAtINdexPath method 

    cell.backgroundColor = [UIColor clearColor]; 
    cell.detailTextLabel.backgroundColor = [UIColor clearColor]; 
    cell.textLabel.backgroundColor = [UIColor clearColor]; 

你也可以切换到任何你想要的分隔符的颜色:

theTableView.separatorColor = [UIColor lightGrayColor]; 
+0

嗯,这是最需要的,因为我希望我的细胞有交替的颜色。此外,我需要他们走到桌子的边缘,而不是在两边都放上一些“衬垫”。 – Ying 2010-12-23 14:40:01

相关问题