【代码笔记】iOS-文字走马灯效果
2016-06-24 08:51
411 查看
一,效果图。
二,工程图。
三,代码。
RootViewController.h
RootViewController.m
二,工程图。
三,代码。
RootViewController.h
#import <UIKit/UIKit.h> @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多图片下载
- iOS RunLoop简介
- iOS开发之支付宝集成
- iOS自动化打包上传的踩坑记
- 源码推荐(0624):模仿iOS7 task switcher的卡片动画,自定义有弧度的 tabBar
- iOS 资源大全
- iOS开发中的数据缓存
- iOS静态库的那些坑
- iOS tableview 加载多张图片 didReceiveMemoryWarning
- iOS 常用第三方库
- 简析iOS动画原理及实现——Core Animation
- [iOS] 在 ios10 中使用 imessage
- iOS内存管理(4)--Block属性用copy修饰 & 避免循环引用的问题
- iOS 获取子视图在父视图中的坐标
- IOS沙盒Files目录说明和常用操作
- Xcode自动断点在[recorder prepareToRecord]
- 解决解析数据网页上只有一个数字,(文本类型)
- MBProgressHUD实现分析
- iOS图片拉伸技巧