目前我的桌面 View 如下所示:正如你所看到的,cell.textLabel 和 cell.detailTextLable 都加载这个背景,我不知道如何让它们停止加载背景,并且它只是单元格上的背景。
这是我当前更改单元格的代码:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
[cell setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"tableCell.png"]]];
}
如何解决这个问题? 提前致谢。
最佳答案
您尝试过[[cell contentView] setBackgroundColor:blabla];
吗?
关于objective-c - TableView 背景图像遍历单元格文本标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9760705/