HLBarIndicatorView 0.2.0

HLBarIndicatorView 0.2.0

测试已测试
Lang语言 SwiftSwift
许可证 MIT
Released最新发布2017年11月
SwiftSwift版本3.0
SPM支持SPM

PandaApe 维护。



  • pandaApe

HLBarIndicatorView

CI Status
Version
License
Platform

示例

Animated gif

要求

  • Swift 3.0
  • iOS 8.0+
  • Xcode 8.0

安装

CocoaPods(推荐)

HLBarIndicatorView 通过 CocoaPods 提供。要安装
它,只需将以下行添加到您的 podfile 中

platform :ios, '8.0'
use_frameworks!

pod "HLBarIndicatorView"

为了获取全部好处,在任何の場所导入 UIKit 时导入 HLBarIndicatorView

import UIKit
import HLBarIndicatorView

手动

  1. 下载并将 HLBarIndicatorView.swift 拖放到您的项目中。
  2. 恭喜你!

使用示例

纯代码初始化:

 let indicatorView = HLBarIndicatorView(frame: CGRect(x: 0, y: 40, width: UIScreen.main.bounds.width, height: 80))

 indicatorView.indicatorType = .barScaleFromRight
 self.view.addSubview(indicatorView)

HLBarIndicatorView 也支持从 Xib 加载

自定义属性

属性 默认值 备注
open var barsCount:Int 5 bar 的数量,必须是奇数
open var indicatorType: HLBarIndicatorType HLBarIndicatorType.barScalePulseOut 提供 3 种样式
open var maxBarHeight: CGFloat 40.0 最大高度
open var minBarHeight: CGFloat 10.0 最小高度
open var barWidth: CGFloat 5.0 Bar 的宽度
open var barsGapWidth: CGFloat 3.0 bar 之间的间隔
open var barCornerRadius: CGFloat 5.0 圆角
open var animationDuration: CFTimeInterval 0.8 执行一次动画所需的时间
open var barColor: UIColor UIColor.white Bar 的颜色

HLBarIndicatorType

case .barScalePulseOut

Animated gif

case .barScaleFromRight

Animated gif

case .barScaleFromLeft

Animated gif

公共方法

 open func startAnimating()
 open func pauseAnimating()

作者

pandaApe, [email protected]

许可证

HLBarIndicatorView 在 MIT 许可下提供。有关更多信息,请参阅 LICENSE 文件。