UITableViewCell - overlapping with previous cells contents

后端 未结 5 1452
名媛妹妹
名媛妹妹 2021-02-08 15:22

I have this wierd problem with my table

  1. i Have about 20 cells to display
  2. Each cell is about 84px in height
  3. When i click no the cell, i have set a
5条回答
  •  深忆病人
    2021-02-08 15:49

    Setting nil to label text on UITableViewCell subclass 's method prepareForReuse() solved my problem -

      override func prepareForReuse() {
        super.prepareForReuse()
        self.label1.text = nil
        self.label2.text = nil
        ....
    }
    

    Shared if it helps anyone!

提交回复
热议问题