Giter Site home page Giter Site logo

xiaohange / jqscrollnumberlabel Goto Github PK

View Code? Open in Web Editor NEW
33.0 4.0 7.0 1.59 MB

JQScrollNumberLabel:仿tumblr热度滚动数字条数, 一个显示数字的控件,当你改变其数字时,能够有滚动的动画,同时动画和位数可以限制,动态创建和实例化可选,字体样式自定义等。

License: MIT License

Objective-C 100.00%
uilabel uiscrollview objective-c swift customlabel customview tumblr-theme tumblr tumblr-blog tumblr-api tumblr-blogs tumblr-reader

jqscrollnumberlabel's Introduction

JQScrollNumberLabel

简介:

JQScrollNumberLabel 仿tumblr热度滚动数字条数,一个显示数字的控件,当你改变其数字时,能够有滚动的动画,同时动画和位数可以限制,动态创建和实例化可选,字体样式自定义等等。

本控件核心采用了好友代培的核心代码,更多样式请看: https://github.com/948080952/DPScrollNumberLabel

JQScrollNumberLabel imitation Tumblr heat rolling digital number, a digital display controls, when you change the numbers, to scroll animation and animation and number restrictions, dynamically create and instantiate the optional custom font style, etc..

效果展示

限制位数:Limit digit

动态创建位数:Dynamic creation bit

仿Tumblr中的热度-滚动数字:Imitation Tumblr in the heat - rolling number

How to use?

将JQScrollNumberLabel文件夹中的两个文件复制进工程,在需要使用的地方导入头文件

The JQScrollNumberLabel folder to copy the two files into the project, where you need to import the header file

#import "JQScrollNumberLabel.h"

@interface ViewController ()

@property (nonatomic, strong)JQScrollNumberLabel *scrollLabel;

@end

初始化的方法传人字体大小或是一个字体,不要设置其frame,只需改变其位置即可,因为它是根据字体大小自动计算自身的大小,若想动态设置位数不要带rowNumber参数即可:

A method to initialize the descendants of font size or a font, do not set the frame, only need to change its position, because it is based on the automatic calculation of the size of its font size, to dynamically set the number of parameters to don't take rowNumber:

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.scrollLabel = [[JQScrollNumberLabel alloc] initWithNumber:@(1) font:[UIFont fontWithName:@"AppleSDGothicNeo-SemiBold" size:40] textColor:[UIColor grayColor] rowNumber:5];
    
    self.scrollLabel.frame = CGRectMake(100, 100, self.scrollLabel.frame.size.width, self.scrollLabel.frame.size.height);
    
    [self.view addSubview:self.scrollLabel];
    
}
@end

当想要改变其数值时,调用下面方法即可,当animated参数为NO时不会播放动画

When you want to change the value, call the following method, when the animated parameter is NO will not play animation

[self.scrollLabel changeToNumber:@(10) animated:YES];

QT

  • 1.目前还不支持负数的显示

  • 2.显示的位数有限制,最大8位

Consultation

iOS开发者交流群:446310206 喜欢就❤️❤️❤️star一下吧!你的支持是我更新的动力! Love is every every every star! Your support is my renewed motivation!

Other

JQTumblrHud-高仿Tumblr App 加载指示器hud

JQScrollNumberLabel:仿tumblr热度滚动数字条数

TumblrLikeAnimView-仿Tumblr点赞动画效果

JQMenuPopView-仿Tumblr弹出视图发音频、视频、图片、文字的视图

License

This code is distributed under the terms and conditions of the MIT license.

jqscrollnumberlabel's People

Contributors

xiaohange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.