jdg / MBProgressHUD

MBProgressHUD + Customizations
http://www.bukovinski.com/
MIT License
16.01k stars 3.56k forks source link

Progress Indicator not centered in iOS 13 #583

Closed moyitpro closed 4 years ago

moyitpro commented 5 years ago

The progress indicator is not centered when the HUD control is shown in iOS 13 original

matej commented 4 years ago

Can you provide reproduction steps for this in the demo project that's part of this repository? I can't reproduce this.

Simulator Screen Shot - iPhone 11 Pro - 2020-01-13 at 22 56 36

moyitpro commented 4 years ago

I can't produce it in the demo app. However, in my app with the updated MBProgressHud, it does not appear properly.

Screenshot 2020-01-13 at 7 43 14 PM

The code is similar to the demo, not sure what I am doing wrong.

 if (show && !_refreshing) {
        _hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
        _hud.label.text = @"Loading";
        if (@available(iOS 13, *)) { }
        else {
            _hud.bezelView.blurEffectStyle = [NSUserDefaults.standardUserDefaults boolForKey:@"darkmode"] ? UIBlurEffectStyleDark : UIBlurEffectStyleLight;
            _hud.contentColor = [ThemeManager sharedCurrentTheme].textColor;
        }
        _refreshing = YES;
    }
    else if (!show) {
        [_hud hideAnimated:YES];
        _refreshing = NO;
    }
    _titleinfobaritem.enabled = !show;
    _shareitembaritem.enabled = !show;
    _optionsitembaritem.enabled = !show;

Note: _hud is a property with the type of MBProgressHUD.

matej commented 4 years ago

Is self.view a table view? I'd not recommend putting the HUD on a table view (see the Readme).

Other than that, I's going to be hard for me to reason about this without concrete reproduction steps in the example or an isolated sample. If you manage to get any more information please feel free to update this ticket or open a PR.

moyitpro commented 4 years ago

I figured out the problem. The library FrameAccessor was causing the issue. I created a subclass for UIView and have the library point to that subclass so that library won't interfere with all the views, only the libraries that need FrameAccessor