0

Duplicate:

can i use highlighted the table view cell without default blue color in objective c?

How can I change the default blue color when selecting the row of UITable?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Possible duplicate of [can i use highlighted the table view cell without default blue color in objective c?](https://stackoverflow.com/questions/733095/can-i-use-highlighted-the-table-view-cell-without-default-blue-color-in-objectiv) – Cœur Mar 14 '18 at 19:19

2 Answers2

4

UITableViewCellSelectionStyle is built in to Cocoa Touch and will give you a few choices. For more customization, you'll need to change your cell manually:

How do I set UITableViewCellSelectionStyle property to some custom color?

Community
  • 1
  • 1
pix0r
  • 31,139
  • 18
  • 86
  • 102
0

in the delegate of the tableview, where you create the cell, you can custom it.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *customCellIdentifier = @"customCellIdentifier ";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
        cell.selectedBackgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"YourBackground.png"]] autorelease];
    }

    // configure the cell
}
jrturton
  • 118,105
  • 32
  • 252
  • 268
larntin
  • 110
  • 1
  • 10