I have an app with storyboard. In one scene I have a tableview with statics cell content. Is possible to change the background selected color to another color out of the def
I had the same problem. The solution has two parts:
1) getting the cells, look at this. 2) changing the background color: you must create a UIView with the background color you need and set it as the selectedBackgroundView of the cell
For instance, I used this code in the viewDidLoad of the uitableviewcontroller:
UIView *backgroundSelectedCell = [[UIView alloc] init];
[backgroundSelectedCell setBackgroundColor:[UIColor colorWithRed:130/256.0 green:169/256.0 blue:171/256.0 alpha:1.0]];
for (int section = 0; section < [self.tableView numberOfSections]; section++)
for (int row = 0; row < [self.tableView numberOfRowsInSection:section]; row++)
{
NSIndexPath* cellPath = [NSIndexPath indexPathForRow:row inSection:section];
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:cellPath];
[cell setSelectedBackgroundView:backgroundSelectedCell];
}