1

我正在尝试自定义 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];

但仍然无法正常工作。有任何想法吗?

编辑:我的错,它正在工作。我在上面渲染了一些东西,但我看不到它。

4

2 回答 2

0

我想你想要这个:

cell.backgroundColor = [UIColor redColor];
于 2011-02-21T16:17:06.890 回答
0

您是否有可能在单元格顶部渲染没有[UIColor clearColor]背景颜色的东西?

编辑:刚刚看到你的编辑......很明显......;)

于 2011-02-22T14:16:57.170 回答