Open sryze opened 7 years ago
Nevermind, found the answer here:
I wrapped my HUD in another view and turned off user interaction there. As a result, it was disabled in the HUD itself.
The reason I did that was another wierd issue with MBProgressHUD - despite specifying a frame with an X coordinate > 0 when calling initWithFrame:
it was resetting to 0 for some reason. Putting it in a container view fixed that. I guess now I need to find the real reason behind it.
// Entirely cover the parent view
UIView *parent = self.superview;
if (parent) {
self.frame = parent.bounds;
}
I don't understand why this is needed, but it would be nice to have this optional if possible.
The component was designed to cover the entire parent view and put the bezel in the center. The code snipped you are referring to is there mainly to have the HUD behave correctly during rotation when added to a window on older systems.
But fair point, the HUD should honor your manually set frame, if you wish to do so.
Even i got same issue, in my objective c project. I fixed the issue as below, but i don't what problem will i get later. Currently it is working fine. -(void)showIndicator { MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:NO]; hud.contentColor = Indicator_FONTRED; hud.bezelView.color = FONTWHITE; [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; }
-(void)hideIndicator { [MBProgressHUD hideHUDForView:self.view animated:NO]; [[UIApplication sharedApplication] endIgnoringInteractionEvents]; }
I'm setting
userInteractionEnabled
toYES
to prevent user from clicking on UI elements but it doesn't work, I still can click on anything underneath the HUD.MBProgessHUD: 0.9.2 iOS 10.3 simulator