解析iOS代码笔记的文字走马灯效果
来源:爱站网时间:2021-07-14编辑:网友分享
近期有朋友来咨询技术频道小编问IOS是怎么实现文字走马灯效果的,必须马上帮大家解决,下文已经整理好相关资料并进行了详细介绍,感兴趣的朋友可以一起和爱站技术频道小编看看是如何解析iOS代码笔记的文字走马灯效果的。
一、效果图

二、工程图

三、代码
RootViewController.h
#import@interface RootViewController : UIViewController @end
RootViewController.m
#import "RootViewController.h"
#import "UXLabel.h"
@interface RootViewController ()
@end
@implementation RootViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
UXLabel* label=[[UXLabel alloc] initWithFrame:CGRectMake(50, 100, 100, 30)];
label.backgroundColor=[UIColor redColor];
label.stringColor=CGRectMake(0, 0, 0, 1);
label.string=@"亲爱的,你好吗?";
label.stringFont=18.0;
[self.view addSubview:label];
[label updateLabel];
}
上文讲述的这篇 解析iOS代码笔记的文字走马灯效果的内容已经全部讲解完,希望对大家的学习有一定的帮助,后续还会带来更多精彩的iOS开发的相关知识内容,感谢大家一直以来对爱站技术频道小编的支持和关注。
