2013-06-28 106 views
2

我有要求顯示UITableViewController完全黑色完全黑色的UITableVIew控制器

我下面的問題面臨

我已經設置單元格的背景色爲黑色。我只有四個條目所以這四個cells是在黑色與白色文本。但是現在還顯示其他空單元,並且這些空單元在白色中。

+0

把一些代碼相關的問題....! –

+0

你想單元格背景黑色或整個表格背景黑色? –

回答

2

使tableView背景顏色爲黑色,並使單元格的背景顏色爲透明顏色。它應該工作。

0

只設置背景顏色你的tableview的黑色從廈門國際銀行一樣

enter image description here

,讓你的細胞背景顏色clearColor。

0
[self.tableView setBackgroundColor:[UIColor blackColor]]; 
5

給你

self.view.backgroundColor = [UIColor blackColor]; 

,也給

self.myTableView.backgroundColor = [UIColor clearColor]; 

如果你不希望看到你的UITableViewCellseparatorStyle然後還寫下面的代碼。

self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone; 

如果您使用所有這些代碼,那麼你可以看到你的UITableView完全黑。

0

從tableview中刪除多餘的空單元格。

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section 
{ 

    if ([self numberOfSectionsInTableView:tableView] == (section+1)) 
    { 

     return [UIView new]; 

    } 

    return nil; 

} 
0

你需要tableview背景顏色黑色。

[yourtableview setBackgroundColor:[UIColor blackColor]]; 

並刪除單元格背景顏色意味着清晰的顏色,它將爲您工作正常。

相關問題