应用于控制器的背景未应用于storyboard swift

时间:2017-11-16 06:58:09

标签: ios uitableview swift3 storyboard

我有一个故事板,其背景图像位于桌面上方。我的问题是背景图像应用于表而不是表格的单元格,它们仍然是白色的。

我做错了什么? 请帮忙

3 个答案:

答案 0 :(得分:2)

您需要将背景颜色设置为tableview单元格的清晰颜色及其内容视图。

答案 1 :(得分:1)

您应该通过以下委托方法清除单元格的背景颜色。

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell,
               forRowAt indexPath: IndexPath) {
    cell.backgroundColor = UIColor.clear
}

答案 2 :(得分:0)

cellForRowAtIndexpath方法中,使用

cell.backgroundColor = UIColor.clear