All Projects → Tr2e → SPScrollNumLabel

Tr2e / SPScrollNumLabel

Licence: MIT License
No description or website provided.

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to SPScrollNumLabel

Attributedlabel
Easy to use, fast, and higher performance than UILabel.
Stars: ✭ 514 (+690.77%)
Mutual labels:  uilabel
Efautoscrolllabel
A label which can scroll when text length beyond the width of label.
Stars: ✭ 111 (+70.77%)
Mutual labels:  uilabel
Dwanimatedlabel
An UILabel subclass that lets you animate text with different types
Stars: ✭ 252 (+287.69%)
Mutual labels:  uilabel
Atributika
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement.
Stars: ✭ 845 (+1200%)
Mutual labels:  uilabel
Skautoscrolllabel
Automatically scrolling UILabel with both horizontal/vertical MARQUEE effects and gradient gradients on the edges. Gradient fading is used on the edge of the scroll to solve the problem of the hard edges of the rolling edge. The overall effect is a natural and easy to use.
Stars: ✭ 64 (-1.54%)
Mutual labels:  uilabel
Cjlabel
A drop-in replacement for UILabel that supports NSAttributedString, rich text, display any view, links, select copy and more
Stars: ✭ 140 (+115.38%)
Mutual labels:  uilabel
Ppcounter
iOS与macOS中一款优雅的数字/金额增减动效组件
Stars: ✭ 451 (+593.85%)
Mutual labels:  uilabel
DossyTextLabel
A subclass of UILabel reminiscent of Strong Bad's faithful Tandy 400.
Stars: ✭ 75 (+15.38%)
Mutual labels:  uilabel
Swiftcocoadsl
An easy way to write iOS UI
Stars: ✭ 103 (+58.46%)
Mutual labels:  uilabel
Cltypinglabel
iOS UILabel with character by character typing /typewriter animation
Stars: ✭ 192 (+195.38%)
Mutual labels:  uilabel
Sodieremojikeyboardplus
支持自定义emoji表情,icon font , FontAwesome,斜体,超链接,粗体,下划线,字体,颜色,镂空字体等富文本
Stars: ✭ 14 (-78.46%)
Mutual labels:  uilabel
Swifticonfont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon)
Stars: ✭ 1,094 (+1583.08%)
Mutual labels:  uilabel
Zswtappablelabel
UILabel subclass for links which are tappable, long-pressable, 3D Touchable, and VoiceOverable.
Stars: ✭ 148 (+127.69%)
Mutual labels:  uilabel
Thlabel
UILabel subclass, which additionally allows shadow blur, inner shadow, stroke text and fill gradient.
Stars: ✭ 636 (+878.46%)
Mutual labels:  uilabel
RZColorful
NSAttributedString富文本的方法集合,以及简单优雅的使用其多种属性
Stars: ✭ 53 (-18.46%)
Mutual labels:  uilabel
Autoscrolllabel
Provides marquee like UILabel scrolling, think Music.app track title scrolling. For Obj-C & Swift.
Stars: ✭ 499 (+667.69%)
Mutual labels:  uilabel
Uilabel Copyable
A simple category to add copy functionality to UILabel.
Stars: ✭ 113 (+73.85%)
Mutual labels:  uilabel
AMXFontAutoScale
⚠️ Experimental automatic cross-device font scaling for UILabel and UITextView.
Stars: ✭ 39 (-40%)
Mutual labels:  uilabel
GravityTagCloudView
A tag cloud view with gravity.
Stars: ✭ 22 (-66.15%)
Mutual labels:  uilabel
Ghosttypewriter
👻 A UILabel subclass that adds a typewriting animation effect
Stars: ✭ 159 (+144.62%)
Mutual labels:  uilabel

SPScrollNumLabel

Version license 996.icu

项目中应用效果

项目应用效果

Ver 0.0.2

Text效果

Ver 0.0.1

Demo效果

Api

@property (nonatomic, assign) IBInspectable NSInteger targetNumber;// default is 0
@property (nonatomic, assign) IBInspectable CGFloat animateDuration;// default is 0.25
@property (nonatomic, assign) IBInspectable BOOL isCommonLabel;// default is NO
@property (nonatomic, assign) BOOL centerPointPriority;// default is NO
- (void)increaseNumber:(NSInteger)increasedNum;
- (void)decreaseNumber:(NSInteger)decreasedNum;
  • 设置目标数字
  • 设置数字滚动的动画时间
  • 设置为普通的UILabel使用
  • 设置是否为center属性优先布局,针对只设置foo.center的情况,详情见Demo
  • 数字增加方法
  • 数字减少方法

设置

  1. 对文字及字体颜色等常见参数的设置,直接通过UILabel的参数设置即可.
  2. 输入数字支持targetNum及text两种属性输入
  3. targetNumber及text的输入,都请放在字体属性设置完成后

注意点:如果输入的文字为中文,请不要设置Label的backgroundColor属性,否则无法正常显示

纯代码

  1. 设置frame时,如果size属性的宽不能适应展示宽度,都会自动调整,如果size属性的高度不能容纳展示高度,会自动调整,能容纳则不做任何处理
  2. targetNumber的赋值,请务必放在配置参数的最后
CGRect screenBounds = [UIScreen mainScreen].bounds;
SPScrollNumLabel *num = [[SPScrollNumLabel alloc] initWithFrame:(CGRect){CGPointMake(screenBounds.size.width/2 - 50, 100),CGSizeMake(2, 100)}];
    
    // 设置frame时
    // 如果size属性的宽不能适应展示宽度,都会自动调整
    // 如果size属性的高度不能容纳展示高度,会自动调整,能容纳则不做任何处理
    // num.frame = (CGRect){CGPointMake(screenBounds.size.width/2 - 50, 100),CGSizeMake(2, 100)};
    
// 字体属性,直接赋值
num.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5];
num.font = [UIFont systemFontOfSize:40 weight:UIFontWeightBold];
num.backgroundColor = [[UIColor purpleColor] colorWithAlphaComponent:0.4];
    
    
// 如果采用center赋值 需要设置是否中心点优先
SPScrollNumLabel *centerLabel = [[SPScrollNumLabel alloc] init];
centerLabel.center = CGPointMake(screenBounds.size.width/2, 250);
centerLabel.centerPointPriority = YES;
centerLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5];
centerLabel.font = [UIFont systemFontOfSize:35 weight:UIFontWeightThin];
centerLabel.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:0.4];
// 属性配置完成后,赋值 默认为0
centerLabel.text = @"998";
    
// 如果想当做普通的UILabel用 比如特殊值"1千"等 打开isCommonLabel 直接按照UILabel的使用即可
SPScrollNumLabel *commonLabel = [[SPScrollNumLabel alloc] init];
commonLabel.isCommonLabel = YES;
commonLabel.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5];
commonLabel.font = [UIFont systemFontOfSize:35 weight:UIFontWeightThin];
commonLabel.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:0.4];
commonLabel.text = @"我可以当普通label用哦";
[commonLabel sizeToFit];
commonLabel.center = CGPointMake(screenBounds.size.width/2, commonLabel.frame.size.height/2+34);

xib

xib支持直接设置,你可以将必要的参数在这里直接设置:颜色字体动画时间是否是个普通Label动画翻转时间 demo 1 demo 2

如何应用

使用pod或者直接拖拽相应文件夹到你的工程下

pod 'SPScrollNumLabel' ,'~> 0.0.2'

20171124 ver 0.0.2:支持label.text的直接赋值

20171123 ver 0.0.1


Enjoy It

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].