iOS 的 HUD ZKProgressHUD

码农软件 · 软件分类 · 指示器(HUD) · 2019-06-14 06:41:23

软件介绍

iOS App 上易于使用的 HUD

demo

运行环境

  • iOS 8.0 +

  • Xcode 8 +

  • Swift 3.0 +

安装

CocoaPods

你可以使用 CocoaPods 安装 ZKProgressHUD,在你的 Podfile 中添加:

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
    pod 'ZKProgressHUD'
end

手动安装

  • 拖动 ZKProgressHUD 文件夹到您的项目

  • 将 ZKProgressHUD.bundle 添加到项目资源中 Targets->Build Phases->Copy Bundle Resources

使用

导入 ZKProgressHUD

import ZKProgressHUD

显示加载

ZKProgressHUD.show()
// Simulation time consuming operation
DispatchQueue.global().asyncAfter(deadline: DispatchTime.now() + .seconds(3), execute: {
    DispatchQueue.main.async {
        ZKProgressHUD.hide()
    }
})

显示加载和文字

ZKProgressHUD.show("loading")
// Simulation time consuming operation
DispatchQueue.global().asyncAfter(deadline: DispatchTime.now() + .seconds(3), execute: {
    DispatchQueue.main.async {
        ZKProgressHUD.hide()
    }
})

显示进度

ZKProgressHUD.showProgress(1 / 10)

显示图片

ZKProgressHUD.showImage(UIImage(named: "image"))

显示图片和文字

ZKProgressHUD.showImage(UIImage(named: "image"), status: "Hello world")

显示信息样式

ZKProgressHUD.showInfo("Hello world")

显示成功

ZKProgressHUD.showSuccess("Hello world")

显示错误

ZKProgressHUD.showError("Hello world")

显示消息(无图)

ZKProgressHUD.showMessage("Hello world")

隐藏

ZKProgressHUD.hide()

延迟隐藏

ZKProgressHUD.hide(delay: 3)

自定义

ZKProgressHUD 可以通过下面方法进行自定义:

setMaskStyle (_ maskStyle : ZKProgressHUDMaskStyle )

setMaskBackgroundColor(_ color: UIColor)

setForegroundColor(_ color: UIColor)

setBackgroundColor(_ color: UIColor)

setFont(_ font: UIFont)

setCornerRadius(_ cornerRadius: CGFloat)

setAnimationStyle(_ animationStyle : ZKProgressHUDAnimationStyle )

setHideDelay(_ hideDelay: Int)

本文地址:https://codercto.com/soft/d/7927.html

可视化未来

可视化未来

[美] 埃雷兹·艾登、[法] 让-巴蒂斯特·米歇尔 / 王彤彤、沈华伟、程学旗 / 浙江人民出版社 / 2015-9 / 54.90元

科学的传播速度有多快?今时今日我们很少谈论上帝了吗?人们什么时候开始用“having sex” 而不用“making love”? 史上的人是在哪岁成名的?语法的变化速度到底有多快?哪些作家被纳粹审查得最彻底? “donut” 什么时候开始取代“doughnut”? 我 们能否预测人类未来?比尔·克林顿和花椰菜哪个更出名? 《可视化未来》一书的两位作者通过与“谷歌图书”的合作,得以有机会研究......一起来看看 《可视化未来》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试