• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How do I change a UITableView's row-cell's color upon user selection?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: [iPhone] Webview stringByEvaluatingJavaScriptFromString
  • Next by Date: Re: [iPhone] Webview stringByEvaluatingJavaScriptFromString
  • Previous by thread: Re: How do I compute the screen width of a particular font?
  • Next by thread: Disabling Exposé in SystemUIMode
  • Index(es):
    • Date
    • Thread