欢迎光临
我们一直在努力

长条形心跳动效,各种自定义属性

建站超值云服务器,限时71元/月

长条形心跳动效,各种自定义属性

项目介绍:

HLBarIndicatorView

Version
License
Platform

Source Code

HLBarIndicatorView

Example

图片描述

Requirements

  • Swift 3.0

  • iOS 8.0+

  • Xcode 8.0

Installation

CocoaPods(recommend):

HLBarIndicatorView is available through CocoaPods. To install
it, simply add the following lines to your Podfile:

platform :ios, '8.0'
use_frameworks!

pod "HLBarIndicatorView"

To get the full benefits import HLBarIndicatorView wherever you import UIKit:

import UIKit
import HLBarIndicatorView

Manually

  1. Download and drop HLBarIndicatorView.swift in your project.

  2. Congratulations!

Usage example

Inited from pure code :

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

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

HLBarIndicatorView also supports loading from Xib

Customization Properties

property default value remark
open var barsCount:Int 5 bar的数量, Must be an ODD Int value
open var indicatorType: HLBarIndicatorType HLBarIndicatorType.barScalePulseOut provides 3 kinds of styles
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的颜色

Note that: As log as you changed these properties, you should call func refresh() to update it.

HLBarIndicatorType:

case .barScalePulseOut:

图片描述
case .barScaleFromRight:

图片描述
case .barScaleFromLeft:

图片描述

Public Methods

 open func startAnimating()
 open func pauseAnimating()

Author

PandaApe, whailong2010@gmail.com

License

HLBarIndicatorView is available under the MIT license. See the LICENSE file for more info.

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 长条形心跳动效,各种自定义属性
分享到: 更多 (0)