Вопрос

I want to know how can I remove my HUD subview from the main view

+ (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.
}

Thanks!

Это было полезно?

Решение

SLHUD *hudView = (SLHUD *)[view viewWithTag:899];
[hudView removeFromSuperview];

Другие советы

Just [[view viewWithTag:899] removeFromSuperview]

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top