Reputation: 335
`UIWindow *tempKeyboardWindow = [[[UIApplication sharedApplication] windows]objectAtIndex:0];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:tempKeyboardWindow animated:YES];
hud.animationType = MBProgressHUDAnimationZoomOut;
hud.dimBackground = YES;
hud.labelText = showString;
`
i need to add hud to my application window ,so i used above code but not working.can any one help me?
Upvotes: 0
Views: 1582
Reputation: 5267
First you need to alloc init it as shown below
self.progressHud = [[MBProgressHUD alloc]initWithView:self.navigationController.view];
Then set it's required properties as below
self.progressHud.labelText = @"Processing Image";
self.progressHud.dimBackground = YES;
self.progressHud.animationType = MBProgressHUDAnimationZoom;
self.progressHud.delegate = self;
Then for show it use below code
[self.navigationController.view addSubview:self.progressHud];
[self.progressHud show:NO];
Upvotes: 1