iOS跑马灯效果,实现文字水平无间断滚动;
使用步骤:
1.将AutoScrollLabel文件夹导入项目中;
2.需要实现的类导入头文件
使用方法:
AutoScrollLabel *autoScrollLabel = [[AutoScrollLabel alloc]initWithFrame:CGRectMake(0, 44, 100, 21)];
autoScrollLabel.text = @"Hi Mom! How are you? I really ought to write more often.";
autoScrollLabel.center = self.view.center;
autoScrollLabel.textColor = [UIColor blackColor];
[self.view addSubview:autoScrollLabel];
Demo下载地址 : GitHub - NSLog-YuHaitao/iOS-AutoScrollLabel: iOS开发中
效果图写完这篇文章之后,有网友和我说这个demo存在bug,后来我发现确实是,所以又写了一个,请大家看一下最新的代码,最新的跑马灯效果代码地址: https://github.com/NSLog-YuHaitao/iOSAutoLabel
网友评论