在ios8.0以下的系統(tǒng)中使用一下方法,找不到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循環(huán)):
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];
???????? }
??? }
}