Search code examples
iosswiftxcodeios14xcode12

Problem with UITableView in XCode 12 and IOS 14


I have a problem after upgrading to XCode 12 and IOS 14.

I normally set the background of a UITableView to .clear, for example:

  @IBOutlet weak var testTableView: UITableView!

and then in the viewDidLoad function:

testTableView.backgroundColor = .clear

This worked just fine for me. But since upgrading to XCode 12 and IOS 14 the background stays standard white until scrolling then it changes to .clear .

I didn't changed anything in my Code and with XCode 11 I didn't had this issue.

Does anyone has the same problem and figured out how to fix it?

thank you in advance


Solution

  • Update: Thank you all for your help.

    I‘ve fixed it! It actually was a problem with the custom TableViewCell I don't know how I assumed that it was the general background of the TableView.(Thanks @Starsky for the hint with custom Cell - i guess you all know after hours of searching for minor bugs you can't come up with the simplest things hahaha). In the override init() function of the custom cell I called self.backgroundColor = .none which caused the bug after setting it to self.backgroundColor = .clear everything works as planed.