2012-12-31 130 views
0
`UIWindow *tempKeyboardWindow = [[[UIApplication sharedApplication] windows]objectAtIndex:0]; 


MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:tempKeyboardWindow animated:YES]; 

hud.animationType = MBProgressHUDAnimationZoomOut; 

hud.dimBackground = YES; 

hud.labelText = showString; 

`MBProgressHUD添加到應用程序窗口

我需要HUD添加到我的應用程序窗口,所以我用上面的代碼但不working.can任何一個幫助我嗎?

+0

顯示, self.window.rootViewController.view上的MBProgressHUD – Rajesh

回答

0

首先,你需要的Alloc初始化它如下圖所示

self.progressHud = [[MBProgressHUD alloc]initWithView:self.navigationController.view]; 

然後設置它需要的屬性如下

self.progressHud.labelText = @"Processing Image"; 
self.progressHud.dimBackground = YES; 
self.progressHud.animationType = MBProgressHUDAnimationZoom; 
self.progressHud.delegate = self; 

然後作秀它使用下面的代碼

[self.navigationController.view addSubview:self.progressHud]; 
[self.progressHud show:NO]; 
相關問題