Crystal
Crystal

Reputation: 29508

UITableViewCell backgroundColor set in IB, shows up black when it's set to white

Ok, so I don't understand why this happens sometimes. When you first drag in a UITableView into your .xib, the tableView background looks white. Then if you change it to another color, and try to switch back to the default with the slash in it, or even white, the TableView shows black. See imageenter image description here

The tableview is set to white. The View for the view controller is set to white, yet I see black in the .xib. However when I actually run the app, it does show white correctly. It just bothers me that I see black like this and don't know why. Does this happen to other ppl? Thanks.

Upvotes: 1

Views: 237

Answers (2)

JackyJohnson
JackyJohnson

Reputation: 3126

Explicitly setting the background color setting to White solves the problem.

However I'd be interested to know the correct answer to the change in behavior of the default setting.

Basically switching background color back to 'default' color after having set it to black with unknown temporal circumstances, the background color doesn't switch back to the default white like when first dragged into storyboard.

I'm not able to find any setting related to the default behavior either. Could be a small bug?

Upvotes: 0

Markus Persson
Markus Persson

Reputation: 1093

Yeah this happens quite frequently. It's not only related to the UITableViewCell but it can happen on all UIViews.

I've stopped using the default value and instead select the actual color even though they are the same. It is only when selecting default it will give this kind of results.

Upvotes: 1

Related Questions