在ios8.0以下的系统中使用一下方法,找不到tag=44等的子控件,ios7中cell上多了一层UITableViewCellScrollView
ios8.0以上使用:
for (UIView *subviews in [cell subviews]) {
if (subviews.tag == 44 || subviews.tag == 11 || subviews.tag == 22 || subviews.tag == 33 || subviews.tag == 55) {
}else{
[subviews removeFromSuperview];
}
}
ios7使用(两个for循环):
for (UIView *views in [cell subviews]) {
for (UIView *subviews in [views subviews]) {
if (subviews.tag == 44 || subviews.tag == 11 || subviews.tag == 22 || subviews.tag == 33 || subviews.tag == 55) {
}else{
[subviews removeFromSuperview];
}
}
}