How do I change a UITableView's row-cell's color upon user selection?
How do I change a UITableView's row-cell's color upon user selection?
- Subject: How do I change a UITableView's row-cell's color upon user selection?
- From: "Frederick C. Lee" <email@hidden>
- Date: Wed, 5 Aug 2009 17:40:47 -0400
Greetings:
The default selection color is blue. I want to use a different color
upon user selection. Here's my code:
(void)tableView:(UITableView *)theTableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [theTableView cellForRowAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor redColor]; // ... for
example, I want to change to 'red'.
[theTableView deselectRowAtIndexPath:indexPath animated:NO];
DJMyJournalFolderCellController *controller = [self.feedItems
objectAtIndex:indexPath.row];
DJNewsSectionViewController *viewController =
[[DJNewsSectionViewController alloc] initWithNibName:@"RSSViewController"
bundle:nil];
viewController.section = controller.item;
[[self navigationController] pushViewController:viewController
animated:YES];
[viewController release];
}
I tried to force a re-display with [<UIView> setNeedsDisplay] but that
doesn't work; probably need to change to boundaries for it to notice.
Is there a way to change the default 'blue' to a different color upon
selecting the row?
Ric.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden