我正在尝试自定义 TTTableViewCell 的背景颜色,但没有成功。
我的 TableViewController 中有以下方法,当用户单击单元格时会执行该方法:
- (void)didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath {
TTTableViewCell* cell = (TTTableViewCell*) [self.tableView cellForRowAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor redColor];}
我也试过这个
cell.backgroundColor = [UIColor redColor];
但仍然无法正常工作。有任何想法吗?
编辑:我的错,它正在工作。我在上面渲染了一些东西,但我看不到它。