我正在使用M13ProgressHUD在我的應用中顯示加載程序。它工作正常,但如果我在加載程序打開時將我的應用程序發送到後臺並返回,加載程序將被凍結。這是爲什麼發生?當應用從後臺返回時,進度HUD會凍結 - iOS
我加入了hud
爲:
_hud = [[M13ProgressHUD alloc] initWithProgressView:[[M13ProgressViewRing alloc] init]];
_hud.progressViewSize = CGSizeMake(60.0, 60.0);
_hud.animationPoint = CGPointMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/2);
_hud.indeterminate = YES;
_hud.primaryColor = [UIColor whisperRed];
_hud.secondaryColor = [UIColor whisperRed];
((M13ProgressViewRing*)_hud.progressView).backgroundRingWidth = 2.0;
_hud.maskType = M13ProgressHUDMaskTypeSolidColor;
UIWindow *window = ((AppDelegate *)[UIApplication sharedApplication].delegate).window;
[window addSubview:_hud];
並將其顯示爲:
dispatch_async(dispatch_get_main_queue(), ^{
// Show an activity indicator
[_hud performAction:M13ProgressViewActionNone animated:YES];
[_hud setStatus:@"Connecting via Facebook"];
[_hud setIndeterminate:YES];
[_hud show:YES];
});
爲什麼漸凍當應用程序返回到前臺,甚至當我是否將它添加到主隊列中?