iOS 7.1 UitableviewCell content overlaps with ones below

前端 未结 7 1780
执念已碎
执念已碎 2020-12-08 07:11

So I have code, which is sucessfully working on iOS 7.0 but not in 7.1. I have a simple tableview, with code:

- (NSInteger)numberOfSectionsInTableView:(UITab         


        
7条回答
  •  春和景丽
    2020-12-08 07:39

    Here is the Perfect solution of Overlapping content in Cells.

    Just use below code in cellForRowAtIndexPath after allocating cell and before adding subviews.

    for (id object in cell.contentView.subviews)
    {
        [object removeFromSuperview];
    }  
    

    Actually the overlapping is occurring because whenever you scroll the tableview its allocating your added view again and again. So above code will solve your problem by removing the existing views from cell's contentView.

    Now You can see the memory debug session after applying above code, your memory is stable this time.

    Hope it'll help you.

    Thanks !

提交回复
热议问题