MBProgressHud视图自定义在Swift 3中不起作用并且不显示吗?

巴哈维克·潘查尔

我正在使用以下代码,但没有显示进度平视显示器,所以请为此提供帮助。

let loadingHUD = MBProgressHUD() 

loadingHUD.mode = MBProgressHUDModeCustomView
loadingHUD.labelText = nil
loadingHUD.detailsLabelText = nil
let customView = UIView.init(frame: CGRect(x: 0, y: 0, width: 80, height: 80))

let gifmanager = SwiftyGifManager(memoryLimit:20)
let gif = UIImage(gifName: "miniballs1.gif")
let imageview = UIImageView(gifImage: gif, manager: gifmanager)
imageview.frame = CGRect(x: 0 , y: 0, width: customView.frame.width, height: customView.frame.height)
customView.addSubview(imageview)
customView.bringSubview(toFront: imageview)

loadingHUD.customView = customView
loadingHUD.customView.bringSubview(toFront: customView)
loadingHUD.show(true)
毛利克·帕特尔

尝试使用此库ACProgressHud-Swift

在xib文件中,无论使用哪种视图,都可以对其进行自定义和使用。

演出

ACProgressHUD.shared.showHUD(withStatus: “Your Message Name“)

为了隐藏

ACProgressHUD.shared.hideHUD()

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章