gpt4 book ai didi

ios - 从 View 中删除 subview

转载 作者:行者123 更新时间:2023-11-28 20:05:41 25 4
gpt4 key购买 nike

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

+ (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];

关于ios - 从 View 中删除 subview ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22157683/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com