跑马灯标签

来源:互联网 发布:基金套利软件 编辑:程序博客网 时间:2024/05/01 12:07

https://github.com/potato512/SYNoticeBrowseLabel

效果图:


使用示例:

// 导入头文件#import "SYNoticeBrowseLabel.h"

// 实例化SYNoticeBrowseLabel *noticeLabel2 = [[SYNoticeBrowseLabel alloc] initWithFrame:CGRectMake(10.0, 140.0, (self.view.frame.size.width - 10.0 * 2), 30.0)];[self.view addSubview:noticeLabel2];noticeLabel2.backgroundColor = [UIColor colorWithWhite:0.5 alpha:0.3];// 文本颜色noticeLabel2.textColor = [UIColor purpleColor];// 文本字体noticeLabel2.textFont = [UIFont systemFontOfSize:15.0];// 文本noticeLabel2.text = @"自定义跑马灯功能类标签。";// 图标noticeLabel2.images = @[[UIImage imageNamed:@"face01"], [UIImage imageNamed:@"face02"], [UIImage imageNamed:@"face03"], [UIImage imageNamed:@"face04"], [UIImage imageNamed:@"face05"], [UIImage imageNamed:@"face06"]];// 点击时是否暂停动画(默认不停NO)noticeLabel2.textAnimationPauseWhileClick = NO;// 文件点击回调noticeLabel2.textClick = ^(){[[[UIAlertView alloc] initWithTitle:nil message:@"点击时,动画不受影响。" delegate:nil cancelButtonTitle:@"知道了" otherButtonTitles:nil, nil] show];};// 动画[noticeLabel2 textAnimation:6.0];



原创粉丝点击