iOS - MBProgressHUD bezelView to be transparent

1.4k Views Asked by At

I am using MBProgressHUD and want to make the bezelView to br transparent.

import UIKit
import MBProgressHUD

class ProgressBarManager {
   func showProgressBar() {
    guard let testView = UIApplication.shared.windows.last else { return }        
    let hud = MBProgressHUD.showAdded(to: testView, animated: true)

    hud.bezelView.layer.cornerRadius = 5
    hud.bezelView.backgroundColor = .clear
    hud.backgroundView.style = .solidColor
    hud.backgroundView.color = UIColor(white: 0, alpha: 0.3)

 }
}

Yet the bezelView still shows:

enter image description here

Is there a way to hide it?

2

There are 2 best solutions below

0
pranita gundale On

Add this line for your hud init code:

hud.bezelView.style = .solidColor
0
Martynas Stanaitis On

After HUD init, set it up with:

hud.bezelView.style = .solidColor
hud.bezelView.color = .clear