view移除所有子视图

如果要移除一个 UIView 的所有子视图,SDK 里没有 remove all 之类的方法。可以用 for loop 循环调用 – removeFromSuperview 来移除

    例如:

for(UIView *view in [self.view subviews])
{
   [view removefromsuperview]
}

posted @ 2014-02-21 16:46  徐坤很无聊  阅读(139)  评论(0编辑  收藏  举报