UITableView background black and empty cells black on iOS 8

Xcode 7.0b3 iOS Deployment Target 8.0

Here's the test app I made to isolate the issue.

Created a

UITableViewController
in a
UINavigationController
. Tap a cell, and pushes another one of those table view controllers. This table view controller has a random number of sections and rows in each section.

On iPhone running iOS 9, table scrolls correctly... empty cells are while. On iPhone running iOS 8, table has black background. Empty rows are black instead of white.

In our "real" app, we sometimes see contents of old UITableView in a new UITableView. So I tried to isolate the issue to see if its a bug building with the Xcode 7 beta.

Does this sound like a bug building with the beta xcode and using iOS 8? Or did we create a bug/doing something wrong?

Replies

I'm having this issue as well

What language and deployment target are you using ?


We are seeing the same issues with iOS9 SDK, Xcode 7b3, Swift 2 and a deployment target of 8.0. Same app works correctly when deployed to an iOS9 device, and in the iOS9 simulator

Same for me. When deployed to a iOS 9 simulator, or iOS 9 device, it works fine, but when deployed to an iOS 8.4 device, it has the black cells.

iOS 9 SDK, Xcode 7b3, Swift 2, deployment target iOS 8.0, device iPhone 5S iOS 8.4 - UITableView presented in UIPopoverPresentationController has black background.

iPad 4 on iOS 8.4 doesn't have this problem.

Setting tableView.backgroundColor = UIColor.whiteColor() fixes issue, but that's only temporary workaround in my opinion

Have you filed this on rdar yet?

Had the same issue in beta 3, just checked this in Xcode 7 beta 4 and it seems to be fixed.

Yeah, it's fixed in Beta 4 if you wanted it to be white. If you had the background set to any other color besides white in the storyboard, it ignores it and makes it white. We had a dark theme with a dark grey background and white text, and now it's all white. If anyone else has this problem, the workaround is to set it in code in addition to the storyboard.

I have the same issue within my universal app - It works for iPhone but not for iPad. All my dark tableviewcell are white in the iPad Simulator. Even with a my code approach it wasn't possible:


func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
 
    var cell = tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell!
 
    / Styling TableCells */
    let colorView = UIView()
    colorView.backgroundColor = UIColor.colorGrayTB()
    cell.backgroundView = colorView
    let selColorView = UIView()
    selColorView.backgroundColor = UIColor.colorGrayTB()
    cell.selectedBackgroundView = selColorView
    / ------------------ */
        
    cell.textLabel!.text  = tableData[indexPath.row]
    cell.textLabel?.textColor = UIColor.whiteColor()
    cell.textLabel?.font = UIFont(name: "HelveticaNeue-Light", size:
 
    return cell
 }

I am using XCode 6.4 and iOS 8.4 - How are you implementing the coloring in code?

Hi everyone! There is a Dark Mode enable in Simulator or device you are using as a developer.

I have solved it by following:

override func viewDidLoad() {
        super.viewDidLoad()
         
        // change to Light Mode:
        overrideUserInterfaceStyle = .light 

        
    }

If you have still part of background other color, you can add the line below:

// change background of tableView
tableView.backgroundColor = .white // set a color you need

Good luck and see you here!