UITableView Cell selected Color?
ios, objective-c, selection-color, uitableview
Solution
I think you were on the right track, but according to the class definition for `selectedBackgroundView`:
The default is nil for cells in plain-style tables (UITableViewStylePlain) and non-nil for section-group tables UITableViewStyleGrouped).
Therefore, if you're using a plain-style table, then you'll need to alloc-init a new `UIView` having your desired background colour and then assign it to `selectedBackgroundView`.
Alternatively, if all you wanted was a gray background when the cell is selected, you could use this:
cell.selectionStyle = UITableViewCellSelectionStyleGray;
Problem
I have created a custom `UITableViewCell`. The table view is showing data fine. What I am stuck in is when user touches cell of tableview, then I want to show the background color of the cell other than the default [blue color] values for highlighting the selection of cell. I use this code but nothing happens: ``` cell.selectedBackgroundView.backgroundColor=[UIColor blackColor]; ```