3

I have inserted a MBProgressHUD view on my image picker controller. It should work as an indicator to take a photo. For this, I customized MBProgressHUD such as below.

- (void) drawRect:(CGRect)rect {
...
CGRect allRect = self.bounds;
UIImage* image = [UIImage imageNamed:@"loadingScreen.png"];
[image drawInRect: allRect];
...
}

I have tested this customization code in everywhere, and it always has been success. But on UIImagePickerController, it doesn't work showing only a indicator and not showing image, "loadingScreen.png".

...
HUD = [[MBProgressHUD alloc] initWithView:imgPicker.view];
[imgPicker.view addSubview: HUD];
...

Please help me to solve it.

Hojun K.
  • 69
  • 2
  • 6

1 Answers1

0
...
HUD = [[MBProgressHUD alloc] initWithView:self.view]; // thats not the custom view
HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"loadingScreen.png"]];
HUD.mode = MBProgressHUDModeCustomView;
[HUD show:YES];
...

Don't forget that "loadingScreen.png" will showed as a still image.

Laszlo
  • 2,803
  • 2
  • 28
  • 33