Reputation: 247
I doing a project where i need to use highlighted table view color not default.
Upvotes: 1
Views: 2286
Reputation: 11
Try referring to this demo - maybe you could have a look at it and get some help.
Upvotes: 1
Reputation: 113300
Of course you can.
There are two methods to achieve this:
UITableViewCell
's selectedBackgroundView
and selectedTextColor
propertiesUITableViewCell
and implement the drawInRect
and setSelected:animated:
methodsThe latter option gives you more flexibility and much better performance, but it might be slightly harder if you haven't used CoreGraphics before.
UPDATE In response to the OP's comment:
Here's how you can use the selectedBackgroundView
property:
UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 60)];
[bgView setBackgroundColor:[UIColor redColor]];
[cell setSelectedBackgroundView:bgView];
[bgView release];
I haven't tried this myself, but it should work.
Upvotes: 9