iOS 跑马灯

2021-05-09  本文已影响0人  神一样的队友

参考文章: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];

上一篇 下一篇

猜你喜欢

热点阅读