【问题标题】:iOS - MBProgressHUD bezelView to be transparentiOS - MBProgressHUD bezelView 是透明的
【发布时间】:2019-03-14 12:26:11
【问题描述】:

我正在使用 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 仍然显示:

有办法隐藏吗?

【问题讨论】:

  • 你试过 hud.backgroundView.color = UIColor.clear 吗?
  • @RajeshKumarR 是的,这使得整个背景变得清晰,而不是像上面那样暗一点

标签: ios swift uiactivityindicatorview mbprogresshud


【解决方案1】:

为你的 hud 初始化代码添加这一行:

hud.bezelView.style = .solidColor

【讨论】:

    【解决方案2】:

    HUD 初始化后,设置:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      • 2015-03-23
      • 1970-01-01
      • 2017-01-11
      • 1970-01-01
      相关资源
      最近更新 更多