I have been using the default colors Grey and Blue for cell selection, but I would like to try a bright orange, however I am not sure how to do custom UITableview selections.
this is the code I am using at the moment..
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleGray;
I have also tried
[cell setSelectionStyle:[UIColor orangeColor]];
but I get a warning saying setSelectionStyle is not an integer something.
You’re getting that error because the program is expecting a
UITableViewCellSelectionStylewhere you have given it aUIColor. I don’t know if there is way to do this programatically, but you could try and use the cell’sselectedBackgroundViewproperty to use your own image:This would go in your
cellForRowAtIndexPathmethod.