重新加载数据后的TableView白细胞

时间:2019-01-14 19:31:16

标签: swift uitableview

从firebase加载数据后出现问题,当我调用重新加载数据时,表视图中填充了新的列表数据,但全为白色,如果单击,则可以正确获取数据值。 如果我使用静态数据,则一切正常。 有什么建议吗?谢谢!

using (var context = new BloggingContext())
{
    var blogs = context.Blogs
        .Include(blog => blog.Posts)
        .ToList();
}

enter image description here

1 个答案:

答案 0 :(得分:0)

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
   guard let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as? UniversityCell else {
      return UITableViewCell()
   }
   cell.name.text = currentUniversityArray[indexPath.row].name
   // Put this background Color
   cell.backgroundColor = .clear
   return cell
}