标准TableView单元格 - 标签文本与uiimage重叠

时间:2017-12-04 10:39:55

标签: ios swift uitableview

这种情况正在发生,但我不知道为什么。它是一个标准的tableviewcell,上面有标签和图像

text overlapping with image

以下是代码:

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = patientsTableView.dequeueReusableCell(withIdentifier: "patientTableViewCell", for: indexPath)
    let text = "Bob Marley"
    cell.textLabel?.text = text
    return cell
}

1 个答案:

答案 0 :(得分:0)

当我没有在对象检查器中放置图像视图但是如下所示时,它解决了问题。我不知道为什么,但

cell.imageView?.image = UIImage(named: "patients")
相关问题