Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yulingtianxia/yxynumberanimationlabel
一个数字动画Label
https://github.com/yulingtianxia/yxynumberanimationlabel
Last synced: 4 days ago
JSON representation
一个数字动画Label
- Host: GitHub
- URL: https://github.com/yulingtianxia/yxynumberanimationlabel
- Owner: yulingtianxia
- License: mit
- Created: 2014-05-26T03:15:52.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-22T08:46:18.000Z (over 9 years ago)
- Last Synced: 2024-04-26T01:41:13.478Z (7 months ago)
- Language: Objective-C
- Size: 355 KB
- Stars: 33
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
YXYNumberAnimationLabel [![Build Status](https://travis-ci.org/yulingtianxia/YXYNumberAnimationLabel.svg?branch=master)](https://travis-ci.org/yulingtianxia/YXYNumberAnimationLabel)
=======================一个数字动画Label
![](demo.gif)
##使用方法
设置AnimationSpeed属性的值可以调节动画变化速度,getter/setter方法如下:
```
-(double)AnimationSpeed;
-(void)setAnimationSpeed:(double)speed;
```字体会根据数字位数来自动调节字体大小,你也可以通过实现numberSizeBlock来自定义字体大小,例如:
```
[self.numberLabel setNumberSizeBlock:^(double number) {
self.numberLabel.font = [UIFont fontWithName:self.numberLabel.font.fontName size:30.0];
}];
```最后调用`changeFromNumber: toNumber: withAnimationTime:`方法来让数字动起来:
```
[self.numberLabel changeFromNumber:1 toNumber:999999999 withAnimationTime:0.001];
```##安装
###CocoaPods Installation
在Podfile中加入:```
pod 'YXYNumberAnimationLabel'
```###Manual Installation
将YXYNumberAnimationLabel文件夹拖拽到你的工程