解决UITableView重绘导致重叠的有关问题
解决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