[英]Remove subview from view
我想知道如何从主视图中删除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.
}
谢谢!
SLHUD *hudView = (SLHUD *)[view viewWithTag:899];
[hudView removeFromSuperview];
只需[[view viewWithTag:899] removeFromSuperview]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.