Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xcode 9 Ios11->;UITableViewController赢得';我什么也没表现出来_Ios_Swift_Uitableview_Uiimageview - Fatal编程技术网

Xcode 9 Ios11->;UITableViewController赢得';我什么也没表现出来

Xcode 9 Ios11->;UITableViewController赢得';我什么也没表现出来,ios,swift,uitableview,uiimageview,Ios,Swift,Uitableview,Uiimageview,我有一个大问题,我已经搜索过了,但没有找到任何东西。 所有这些都工作了,然后我将此代码放在UITableViewController类的viewDidLoad()中 let imageView = UIImageView(frame: self.view.frame) let image = UIImage(named: "sample")! imageView.image = image self.tableView.backgroundView = image

我有一个大问题,我已经搜索过了,但没有找到任何东西。 所有这些都工作了,然后我将此代码放在UITableViewController类的
viewDidLoad()

    let imageView = UIImageView(frame: self.view.frame)
    let image = UIImage(named: "sample")!
    imageView.image = image
    self.tableView.backgroundView = imageView
如果我运行它,它只显示背景和单元格中的一些行,但不显示文本:


您的代码将图像放在视图上,而不是放在tableView上。如果你想把它放在tableView上,你需要把它放在单元格上。@MuhammadFauziMasykur但是
self.view
是表格视图,如果这是
UITableViewController
。我认为将自定义子视图添加到UITableView中是不正确的…你的tableView和TableViewCells的背景设置为清除吗?是的,我将其全部设置为清除