iOS 上下滚动的跑马灯label
Shell Objective-C Ruby
Switch branches/tags
Nothing to show
Latest commit b59a0dc Apr 20, 2017 @Verchen 删除冲突
Permalink
Failed to load latest commit information.
Classes
WCScrollLabelViewDemo
.gitignore Initial commit Apr 19, 2017
.swift-version
LICENSE
README.md 修改 Apr 20, 2017
WCScrollLabelView.podspec
效果图.gif

README.md

WCScrollLabelView

上下滚动的label

导入

pod 'WCScrollLabelView'

使用

    NSArray *titles = @[@"这是第一条这是第一条这是第一条这是第一条",@"这是第二条",@"这是第三条",@"这是第四条"];
    
    scrollLabelView = [[WCScrollLabelView alloc] initWithFrame:CGRectMake(50, 100, 200, 20)];
    scrollLabelView.backgroundColor = [UIColor whiteColor];
    scrollLabelView.delegate = self;
    scrollLabelView.titleArray = titles;
    //设置label的字体
    scrollLabelView.titleFont = [UIFont systemFontOfSize:15];
    //设置文字颜色
    scrollLabelView.titleColor = [UIColor redColor];
    //设置停留时间
    scrollLabelView.stayInterval = 3.f;
    //设置滚动动画时间
    scrollLabelView.animationDuration = 1.f;
    [self.view addSubview:scrollLabelView];
    //开始滚动
    [scrollLabelView beginScrolling];

代理

- (void)scrollLabelView:(WCScrollLabelView *)scrollLabelView didClickAtIndex:(NSInteger)index
{
    NSLog(@"点击%zd",index);
}

效果图

image