【问题标题】:Remove subview from view从视图中删除子视图
【发布时间】:2014-03-03 21:19:31
【问题描述】:

我想知道如何从主视图中删除我的 HUD 子视图

+ (SLHUD *)Mostrar:(UIView *)view{


SLHUD *hudView = [[SLHUD alloc] initWithFrame:view.bounds]; // Creates an instance of the object.

hudView.opaque = NO;
[hudView setTag:899];
[view addSubview:hudView]; // Adds the HUD as a subview on top of the view object.

view.userInteractionEnabled = NO; // Sets the user interaction to no because we don't want the user to interact with the HUD.

[hudView showAnimated]; // Calls the method showAnimated to perform an animation.

return hudView; // Returns the object to the caller.
}

谢谢!

【问题讨论】:

    标签: ios view subview


    【解决方案1】:
    SLHUD *hudView = (SLHUD *)[view viewWithTag:899];
    [hudView removeFromSuperview];
    

    【讨论】:

      【解决方案2】:

      只要[[view viewWithTag:899] removeFromSuperview]

      【讨论】:

        猜你喜欢
        • 2011-01-25
        • 1970-01-01
        • 1970-01-01
        • 2013-05-31
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多