Q:

iOS: Sides of UITableViewCell showing a different color when cell background is changed (Xcode 8, Swift 3)

When implementing a UITableView, I added a background image and set the table view to transparent. However, the sides of the table remain clear even when I change the table view cells to a different color (in order to see the text better), as shown in this image: Table View Cell.
The code I added to get the inner part of the table view:
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
        cell.backgroundColor = UIColor(white: 1, alpha: 0.25)
        cell.accessoryView?.backgroundColor = UIColor(white: 1, alpha: 0.25)
        cell.contentView.backgroundColor = UIColor(white: 1, alpha: 0.25)
        cell.tintColor = UIColor(white: 1, alpha: 0.25)
}

And in viewWillAppear:
self.tableView.backgroundColor = UIColor(white: 1, alpha: 0.25)

I'm not sure why the sides don't show up as the same color. I thought it had something to do with the accessory button, but when attempting to change that as well, nothing was changed.

A:

The contentView doesn't cover the whole cell. Try making the setting its background color to the clear color. Then only the cell's background view will show through.

