UITableViewCell - overlapping with previous cells contents

后端 未结 5 1454
名媛妹妹
名媛妹妹 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:45

    You can use

    [[[cell contentView] subviews] makeObjectsPerformSelector: @selector(removeFromSuperview)];
    

    If the cell in not nil, the above code will reduce the time for using the for loop similar to this

    for(UIView *eachView in [cell subviews])
        [eachView removeFromSuperview];
    

提交回复
热议问题