cell imageView in UITableView doesn't appear until selected

前端 未结 8 1925
慢半拍i
慢半拍i 2020-12-24 01:44
  1. Here is a video of the problem: http://youtu.be/Jid0PO2HgcU

  2. I have a problem when trying to set the image for the [cell imageView] in a UITableView

相关标签:
8条回答
  • 2020-12-24 02:43

    I was having a similar problem. I had registered the default UITableViewCell class instead of my custom class.

    I had this:

    tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: visibilityCellIdentifier)
    

    but I should have had this:

    tableView.registerClass(VisibilityCell.self, forCellReuseIdentifier: visibilityCellIdentifier)
    

    The cell creation all looked to be working as I stepped through the debugger, but nothing showed up until I selected each row.

    0 讨论(0)
  • 2020-12-24 02:43

    Sometime it happens when you are using custom UITableViewCell with labels, images etc but also somewhere you are setting default UILabel of cell. for example

    customCell.textLabel.text = @"some text"
    

    To solve this problem, avoid using default label, instead add your own UILabel in your custom cell.

    0 讨论(0)
提交回复
热议问题