参考文章:https://www.jianshu.com/p/8f1f1b1ee814
使用第三方框架TXScrollLabelView
使用Podfile 导入
pod'TXScrollLabelView'
代码
TXScrollLabelView*scrollLabelView = [TXScrollLabelView scrollWithTextArray:@[@"111111",@"22222222"] type:(TXScrollLabelViewTypeFlipNoRepeat) velocity:3 options:(UIViewAnimationOptionCurveEaseInOut) inset:UIEdgeInsetsMake(0,5,0,5)];
[self.view addSubview:scrollLabelView];
scrollLabelView.backgroundColor= [UIColor clearColor];
scrollLabelView.scrollTitleColor= [UIColor blackColor];
scrollLabelView.textAlignment=NSTextAlignmentLeft;
scrollLabelView.frame=CGRectMake(15,5,screen_width-30,40);
//开始滚动
[scrollLabelView beginScrolling];
网友评论