SimpleLoadingView 中文說明文檔
一個用Swift寫的用于iOS的簡單易用、定制性高的Loading界面。
Demo.gif
要求
- iOS 8.0 以上
- Xcode 8.0 以上
- Swift 3.0 以上
安裝
使用Carthage (推薦)
github "pangpingfei/SimpleLoadingView"
import SimpleLoadingView
使用源代碼
- 把
SimpleLoading.swift
SimpleLoadingView.swift
拖到你的Xcode項目中。 - 恭喜!
使用
基本用法
// 只顯示菊花
SimpleLoading.show()
// 只顯示文本
SimpleLoading.show(.text("Welcome!"))
// 顯示菊花和文本
SimpleLoading.show(.textRight("Loading"))
// 在一個View中
SimpleLoading.show(inView: self.view)
// 手動隱藏
SimpleLoading.hide()
// 顯示后定時隱藏
SimpleLoading.show(duration: 2)
你可以在枚舉
SimpleLoading.Style
中看到所有樣式。
個性化設置
SimpleLoading.Config.maskViewAlpha = 0.5 // 遮罩透明度
SimpleLoading.Config.viewBorderWidth = 1 // 邊框寬
SimpleLoading.Config.activityStyle = .whiteLarge // 菊花樣式
SimpleLoading.Config.textColor = .white // 文本顏色
SimpleLoading.Config.verticalPadding = 30 // 垂直方向內邊距
// ...
你可以在結構體
SimpleLoading.Config
中查看所有可設置屬性。
行距(間距), 外距, 內距 的說明
Desc.png
更多……
請用Git克隆項目后參考演示工程。
許可
MIT,詳見LICENSE。