gpt4 book ai didi

iphone - SVProgressHud 几秒后消失

转载 作者:行者123 更新时间:2023-11-28 22:27:44 32 4
gpt4 key购买 nike

我在我的应用程序中添加了 SVProgressHud,并且在大多数 viewController 中工作得非常好。但是当我显示 SVProgressHud 时,它在导航 Controller 的第一个子节点中的行为很奇怪,但几秒钟后它会消失,只显示事件指示器。
看到这个图像,当我显示 progressHud 时显示

enter image description here

这将在几秒钟后显示

enter image description here

我在 viewDidLoad 方法中展示了这个进度,这里是我的代码。

- (void)viewDidLoad
{
[super viewDidLoad];

[SVProgressHUD show];
[SVProgressHUD showWithStatus:nil maskType:SVProgressHUDMaskTypeBlack];
[self performSelector:@selector(CallLanSelectDataWS) withObject:@"" afterDelay:0.1];
}

并在流程完成后关闭 SVProgressHud。

最佳答案

在后台线程中执行任务?

[SVProgressHUD show];

//Execute your task in differentthread
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

[self callLanSelectDataWS];

// After this task is done switch back to main thread
dispatch_async(dispatch_get_main_queue(), ^{

[SVProgressHUD showSuccessWithStatus:@"YEAH!"];
});
});

关于iphone - SVProgressHud 几秒后消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18457907/

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