문제

I use this code to init MBProgressHUD

    UIWindow *window = [[UIApplication sharedApplication] keyWindow]  
    _hud = [[MBProgressHUD alloc]initWithWindow:window];
    _hud.dimBackground = bDim;
    _hud.labelText = message;
    [window addSubview:_hud];
    [_hud show:YES];

but sometimes _hud not show in window ? Anyone let me know where im lack here?? Thanks!

도움이 되었습니까?

해결책

Click here! This works for me .Just use this window.

UIWindow *keyWindow = [[[UIApplication sharedApplication] delegate] window];

Or you can use

self.navigationController.view 

to add you HUD.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top