UITableView backgroundColor always white on iPad

后端 未结 16 1392
生来不讨喜
生来不讨喜 2020-12-07 21:35

I\'m working on a project. I have plenty of UITableViews which are set as clear color. Their views\' background color are set to my custom color and everything

16条回答
  •  时光说笑
    2020-12-07 22:21

    SWIFT

    This was a happening to me, too. My table view in my SWRevealViewController appeared white on my iPad when it looked clear (which is how I wanted it with a background image) on my iPhone. I tried all of the above but this is what ended up working for me in my viewDidLoad().

    tableView.backgroundView = UIImageView(image: UIImage(named: "gray"))
    tableView.backgroundView?.backgroundColor = .clearColor()
    UITableViewCell.appearance().backgroundColor = .clearColor()
    

提交回复
热议问题