2010-12-22 49 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

相關問題