1. for循环
for(UIView *subview in view.subviews){
[subview removefromsuperview];
}
2.一次性移除
[view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
for(UIView *subview in view.subviews){
[subview removefromsuperview];
}
[view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
本文标题:移除所有子视图
本文链接:https://www.haomeiwen.com/subject/lwsluttx.html
网友评论