iOS- MBProgressHUD bezelView变为透明

问题描述 投票:0回答:1

我正在使用MBProgressHUD,并希望将bezelView设为br透明。

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)

 }
}

但是bezelView仍然显示:

enter image description here

是否可以隐藏它?

ios swift uiactivityindicatorview mbprogresshud
1个回答
0
投票
let hud = MBProgressHUD.showAdded(to: self.view, animated: true)
hud.backgroundColor = UIColor.clear
hud.bezelView.backgroundColor = UIColor.clear
hud.bezelView.color = UIColor.clear
hud.bezelView.style = .solidColor
© www.soinside.com 2019 - 2024. All rights reserved.