1 Star 0 Fork 0

Reyzhang2010 / YFRollingLabel

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

YFRollingLabel

YFRollingLabel is a rolling Label using NSTimer.

博客园记录: 【IOS】自定义可点击的多文本跑马灯YFRollingLabel

Effection:

if only one text need to be shown it will roll in a fixed direction automatic.

 ![LongText](LongText.gif)

if more than one text need to be shown it will roll circularly.

 ![TextArray](TextArray.gif)

if the width of the only one text is smaller than view's width it won't roll.  ShortText

Please notice that Only Two Labels are used in this "YFRollingLabel".

so if you set the "InternalWidth" and text a short width, it will break into showing the next label suddenly instead of smothly;

How To Use It?

1.import "YFRollingLabel.h"

2.Initialization:

YFRollingLabel *label = [[YFRollingLabel alloc] initWithFrame:frame textArray:@[@The first One”,@“The Second One”,@“The Third One”,@“The Last One”] font:[UIFont systemFontOfSize:20] textColor:[UIColor whiteColor]];

3.Property:

speed:         pixel rolling for every 0.02s, default : 1.0f.
internalWidth: the width between two labels, default : a third of view's width.
orientation:   rolling from left to right or not: default : RollingOrientationLeft.

4.Method about Timer:

-(void)beginTimer;    start rolling. 
-(void)pauseTimer;    pause rolling. 
-(void)stopTimer;     stop  rolling. 

5.ClickEventBlock:

label.labelClickBlock = ^(NSInteger index){	
	//Your Code.
};

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/reyzhang/YFRollingLabel.git
git@gitee.com:reyzhang/YFRollingLabel.git
reyzhang
YFRollingLabel
YFRollingLabel
master

搜索帮助