Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MBProgressHUD custom view doesn't appear

I'm trying to show an image on MBProgressHUD by using this code

MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.navigationController.view addSubview:HUD];
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark"]] autorelease];
HUD.mode = MBProgressHUDModeCustomView;
HUD.labelText = @"تم إرسال وزنك بنجاح";

[HUD show:YES];
[HUD hide:YES afterDelay:1.5];

but this is what i get

enter image description here

what is the problem ?

like image 651
OXXY Avatar asked Jul 21 '13 07:07

OXXY


1 Answers

I tried your code and it is working for me.

In MBProgressHud.h file, in comments it is mentioned that

/**
 * The UIView (i.g., a UIIMageView) to be shown when the HUD is in MBProgressHUDModeCustomView.
 * For best results use a 37 by 37 pixel view (so the bounds match the build in indicator bounds). 
 */

So perhaps the image you used is missing or is noyt included. Please check that.

like image 136
Puneet Sharma Avatar answered Oct 04 '22 23:10

Puneet Sharma