如何在 PFQueryTableViewController 中为 tableView 设置背景图片

How to set background image for tableView in PFQueryTableViewController

viewDidLoad 中的此代码适用于将背景图像添加到通用 tableViewController 中的 tableView,但是使用 Parse SDK,它不会在 tableViewController 中添加背景图像PFQueryTableViewController。我在 PFQTVC 中做错了什么?

peopleTableView.backgroundView = UIImageView(image: UIImage(named: "SFStreetcar"))  

事实证明,只需将代码放在 viewWillLayoutSubViews 中就可以了:

 override func viewWillLayoutSubviews() {
        tableView.backgroundView = UIImageView(image: UIImage(named: "SFStreetcar"))
    }

如果这不起作用,尽管@user2792129 的解决方案也值得探索。