Open hixfield opened 4 years ago
Maybe the same problem with me. It seems there is something wrong in this method:
@implementation MBBackgroundView
#pragma mark - Lifecycle
- (instancetype)initWithFrame:(CGRect)frame {
if ((self = [super initWithFrame:frame])) {
_style = MBProgressHUDBackgroundStyleBlur;
if (@available(iOS 13.0, *)) {
#if TARGET_OS_TV
_blurEffectStyle = UIBlurEffectStyleRegular;
#else
_blurEffectStyle = UIBlurEffectStyleSystemThickMaterial;
#endif
// Leaving the color unassigned yields best results.
} else {
_blurEffectStyle = UIBlurEffectStyleLight;
_color = [UIColor colorWithWhite:0.8f alpha:0.6f];
}
self.clipsToBounds = YES;
[self updateForBackgroundStyle];
}
return self;
}
@end
One solution is to change _blurEffectStyle = UIBlurEffectStyleSystemThickMaterial;
to _blurEffectStyle = UIBlurEffectStyleLight;
Another solution is as follows(Objc): hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
I use the following code to briefly show a custom view with icon that fades away automatically:
This has always worked on <iOS 13:
ios12.mov.zip
now in iOS 13 the view is much lighter the the desired (background) color. And if you pay attention initially is drawn correctly but a fraction of a second later the color is suddenly much lighter. Also when disappearing there is a brief flicker where the color is correct:
ios13.mov.zip