开发者

iPhone + clear all UI Controls from View

I have a view in which I have few labels an开发者_StackOverflowd I want to dynamically clear the view (remove all the labels) at certain condition in my application.

Please help me

Regards, Pratik


Your most logical option is to use a separate view for the next stage of your interface rather than changing them out, maybe using UIViewControllers.

If you really want to do this, though:

for (UIView *v in myView.subviews) {
    // Include the if-statement if you want to remove UIControls only
    if ([v isKindOfClass:[UIControl class]]) {
        [v removeFromSuperview];
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜