Alex Rivera | Logout

Need to change the color of table view selection

Asked 2009-09-28T06:22:50.800
24

I need to change the default blue color selection of table view to some custom color. Is there any way to do that. Help me

Edit
Report

1 Answer

3

I do not think you can use a custom color. However, you can use the following property of UITableViewCell

@property(nonatomic) UITableViewCellSelectionStyle selectionStyle

The selection style is a backgroundView constant that determines the color of a cell when it is selected. The default value is UITableViewCellSelectionStyleBlue. Since

typedef enum {
   UITableViewCellSelectionStyleNone,
   UITableViewCellSelectionStyleBlue,
   UITableViewCellSelectionStyleGray
} UITableViewCellSelectionStyle;

you can switch from the default blue to gray, or no colored selection at all.

answered 2009-09-28T06:56:34.460

Your Answer