How to customize the background color of a TTTableViewCell? (Three20 framework)
I am trying to customize the background color of a TTTableViewCell with no success.
I have the following method in my TableViewController which gets executed when the user clicks on a cell :
- (void)didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath {
TTTableViewCell* cell = (TTTableViewCell*) [self.tableView cellForRowAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor redColor];}
I also tried this
cell.backgroundColor = [UIColor redColo开发者_开发知识库r];
but still not working. Any ideas?
Edit: My fault, it is working. I was rendering something on top and I could not see it.
Is it possible that you are rendering something on top of your cell that doesn't have [UIColor clearColor]
as background color?
EDIT: Just saw your edit... So obviously... ;)
I think you want this:
cell.backgroundColor = [UIColor redColor];
精彩评论