`
prevention
  • 浏览: 70135 次
社区版块
存档分类
最新评论

iOS Dev (57) 解决UITableView重绘导致重叠的问题

阅读更多

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

{

    NSString * cellID = @"basePlayerControlSelected";

 

UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID];

 

if (cell == nil)

{

cell = [[UITableViewCellalloc] initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:cellID];

    }

    else

    {

        while ([cell.contentView.subviews lastObject] != nil) {

            [(UIView*)[cell.contentView.subviews lastObject] removeFromSuperview];  //删除并进行重新分配

        }

    }

    

    // TODO

 

}

 

参考:http://blog.sina.com.cn/s/blog_75b6e3a601015u4s.html

0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics