iPhone, how can I make my UITableView cells black with and without data in them?
I'm managed to make my UITableView rows / cells black when data is loaded, to a fashion, I get a white line in between rows, which makes it look awful. How can i make them fully black with and without data ?
Heres the code I'm using at the moment
- (void)tableView:(UITableView *)tableView willDisplayCell:
(UITableViewCell *)cell forRowAtIndexPath:(NS开发者_Go百科IndexPath *)indexPath {
cell.backgroundColor = [UIColor blackColor];
}
Heres what I get (with white lines remaining) :(
Change the separator style of your table view.
yourTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
You can do it in Interface Builder too on the properties palette.
-- Edit for clarity following comments below --
Set the entire tableView to have a black background:
[yourTableView setBackgroundColor:[UIColor blackColor]];
This can also be done in the Interface Builder properties panel.
精彩评论