iOS 金额跳动显示动画
我们平时在做关于金额显示时,一个冷冰冰的金额放在label上总是感觉缺一点什么。我们可以对显示的金额做一个从0增长跳动到相应数字的动画效果。我们来看看实现过程
主页面
#import "ViewController.h"
@interface ViewController ()
@property (nonatomic, strong) UILabel *moneyLabel;
@property (nonatomic, strong) NSTimer *balanceLabelAnimationTimer;
@end
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.moneyLabel];
[self setNumberTextOfLabel:self.moneyLabel WithAnimationForValueContent