objective-c - TableView 背景图像遍历单元格文本标签

标签 objective-c ios uitableview

目前我的桌面 View 如下所示:this is my current 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/

相关文章:

ios - 如何以编程方式为非 ARC xcode 项目中的特定文件启用 ARC?

ios - 获取与自身具有多对多链接的链接实体?

ios - 从另一个类的委托(delegate)中访问 IBOutlet

ios - NSDictionary 和 UITableView 副标题

ios - UITableViewcell 未重用

ios - UIView 在 cellForRowAtIndexPath 中再次重叠/创建

ios - 捏缩放 ScrollView 内 UIImageView 的效果?

objective-c - 将 NSString 中每个句子的首字母大写

iphone - UIActionSheet 中的 UIDatePicker 分层问题

ios - 同步 UISlider 和 UIScrollView