ios - 你如何在 Swift 中使用 MBProgressHUD CustomView/Determinate Loader?

标签 ios swift mbprogresshud

我正在尝试在 Swift 中运行 MBProgressHUD。我发现我能够运行一个与 UIAlert 微调器非常相似的微调器,但我在使用其他功能时遇到了问题。根据 MBProgress 文档,您还可以使用确定的加载程序以及其他功能,包括可以成功加载的 CustomView。我想弄清楚如何在 Swift 中加载和访问这些其他函数。

这是不确定微调器的当前代码(我可以使用的唯一函数):

let loadingNotification = MBProgressHUD.showHUDAddedTo(self.view, animated: true)
loadingNotification.mode = MBProgressHUDMode.Indeterminate
loadingNotification.labelText = "Loading"

关闭 ProgressHUD:

MBProgressHUD.hideAllHUDsForView(self.view, animated: true)

请原谅这么简单的问题。我是编程的新手。非常感谢您的帮助!

最佳答案

我认为一个月后,你已经解决了它,但如果没有,我认为这对你有用:

loadingNotification.hide(true)

或延迟:

loadingNotification.hide(true, afterDelay: 3)

希望对您有所帮助! :)

关于ios - 你如何在 Swift 中使用 MBProgressHUD CustomView/Determinate Loader?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30066207/

相关文章:

ios - 当 Storyboard上的 UITableViewController 单击 iOS 时显示 UIAlertView 或任何对话进度

ios - 捕获 cellForRowAt 之外的单元格值

ios - 在两个 UITableViewCells 之间添加一个 View ( ImageView )

ios - SwiftUI - 如何使水平 ScrollView RTL 友好?

ios - SWIFT: 'SecPolicy' 没有名为 'takeRetainedValue' 的成员

ios - 从后台恢复后应用程序屏幕变成全黑

arrays - SWIFT:努力在数组中添加随机名称

iphone - 使用 dispatch_async 加速搜索?

swift - MBProgressHUD 不同的加载方式

ios - MBProgressHUD 导致 iOS 应用程序崩溃(Swift 2.0)