UI-IImageView、UILable作业
2015-12-02 08:25
309 查看
self.window=[[UIWindow
alloc]initWithFrame:[UIScreen
mainScreen].bounds];
//makeKeyAndVisible让窗口是一个主窗口
并且显示在屏幕上
[self.window
makeKeyAndVisible];
ViewController *vc = [[ViewController
alloc]
init];
self.window.rootViewController = vc;
self.window.backgroundColor=[UIColor
whiteColor];
#pragma mark----------第一题--------
/* UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(107, 50, 200, 40)];
[self.window addSubview:lable];
lable.backgroundColor=[UIColor redColor];
lable.text=@"春色满园";
lable.font=[UIFont boldSystemFontOfSize:36];
lable.textColor=[UIColor blackColor];
lable.textAlignment=NSTextAlignmentCenter;
UILabel *lable1=[[UILabel alloc]initWithFrame:CGRectMake(50,150 ,50 ,400 )];
[self.window addSubview:lable1];
lable1.textAlignment=NSTextAlignmentCenter;
lable1.backgroundColor=[UIColor redColor];
lable1.text=@"大地歌唤彩云";
lable1.font=[UIFont boldSystemFontOfSize:36];
lable1.textColor=[UIColor blackColor];
lable1.numberOfLines=6;
UILabel *lable2=[[UILabel alloc]initWithFrame:CGRectMake(314, 150, 50, 400)];
[self.window addSubview:lable2];
lable2.textAlignment=NSTextAlignmentCenter;
lable2.backgroundColor=[UIColor redColor];
lable2.text=@"满园春关不住";
lable2.font=[UIFont boldSystemFontOfSize:36];
lable2.textColor=[UIColor blackColor];
lable2.numberOfLines=6;
//[self performSelector:@selector(start) withObject:nil afterDelay:5];
*/
//[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(start) userInfo:nil repeats:YES];
#pragma mark-----第三题--------
// imagView=[[UIImageView alloc]initWithFrame:CGRectMake(100,100 ,300 ,300 )];
// [self.window addSubview:imagView];
// imagView.animationDuration=1;
// UIImage *a=[UIImage imageNamed:@"1.tiff"];//给动画准备图片素材
// UIImage *a1=[UIImage imageNamed:@"2.tiff"];
// UIImage *a2=[UIImage imageNamed:@"3.tiff"];
// UIImage *a3=[UIImage imageNamed:@"4.tiff"];
// UIImage *a4=[UIImage imageNamed:@"5.tiff"];
// UIImage *a5=[UIImage imageNamed:@"6.tiff"];
// UIImage *a6=[UIImage imageNamed:@"7.tiff"];
// UIImage *a7=[UIImage imageNamed:@"8.tiff"];
// UIImage *a8=[UIImage imageNamed:@"9.tiff"];
// UIImage *a9=[UIImage imageNamed:@"10.tiff"];
// UIImage *a10=[UIImage imageNamed:@"11.tiff"];
// UIImage *a11=[UIImage imageNamed:@"12.tiff"];
// UIImage *a12=[UIImage imageNamed:@"13.tiff"];
// NSArray *list=@[a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12];
// imagView.animationImages=list;
// imagView.animationRepeatCount=1;//0;//给动画设置次数
// [imagView startAnimating];
// [self performSelector:@selector(first) withObject:nil afterDelay:5];
#pragma mark---第四题--------
imagView=[[UIImageView
alloc]initWithFrame:CGRectMake(0,0
,414 ,736)];
[self.window
addSubview:imagView];
imagView.animationDuration=1;
UIImage *a=[UIImage
imageNamed:@"1.tiff"];//给动画准备图片素材
UIImage *a1=[UIImage
imageNamed:@"2.tiff"];
UIImage *a2=[UIImage
imageNamed:@"3.tiff"];
UIImage *a3=[UIImage
imageNamed:@"4.tiff"];
UIImage *a4=[UIImage
imageNamed:@"5.tiff"];
UIImage *a5=[UIImage
imageNamed:@"6.tiff"];
UIImage *a6=[UIImage
imageNamed:@"7.tiff"];
UIImage *a7=[UIImage
imageNamed:@"8.tiff"];
UIImage *a8=[UIImage
imageNamed:@"9.tiff"];
UIImage *a9=[UIImage
imageNamed:@"10.tiff"];
UIImage *a10=[UIImage
imageNamed:@"11.tiff"];
UIImage *a11=[UIImage
imageNamed:@"12.tiff"];
UIImage *a12=[UIImage
imageNamed:@"13.tiff"];
NSArray *list=@[a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12];
imagView.animationImages=list;
imagView.animationRepeatCount=0;//0;//给动画设置次数
[imagView
startAnimating];
UILabel *lable=[[UILabel
alloc]init];
lable.frame=CGRectMake(50,
400, 100,
40);
lable.backgroundColor=[UIColor
whiteColor];
lable.text=@"用户名 ";
lable.textColor=[UIColor
redColor];
lable.font=[UIFont
systemFontOfSize:24];
lable.textAlignment=NSTextAlignmentCenter;
[self.window
addSubview:lable];
UILabel *lable1=[[UILabel
alloc]init];
lable1.frame=CGRectMake(200,
400, 200,
40);
lable1.backgroundColor=[UIColor
whiteColor];
[self.window
addSubview:lable1];
UILabel *lable2=[[UILabel
alloc]init];
lable2.frame=CGRectMake(50,
500, 100,
40);
lable2.backgroundColor=[UIColor
whiteColor];
lable2.text=@"密码 ";
lable2.textColor=[UIColor
redColor];
la
dd6f
ble2.font=[UIFont
systemFontOfSize:24];
lable2.textAlignment=NSTextAlignmentCenter;
[self.window
addSubview:lable2];
UILabel *lable3=[[UILabel
alloc]init];
lable3.frame=CGRectMake(200,
500, 200,
40);
lable3.backgroundColor=[UIColor
whiteColor];
[self.window
addSubview:lable3];
return
YES;
}
#pragma mark--------第二题----------
-(void)start{
NSMutableArray *list=@[@{@"name1":@"家庭幸福",@"name2":@"欢天喜地度佳节",@"name3":@"张灯结彩迎新春"},@{@"name1":@"好事临门",@"name2":@"迎新春事事如意",@"name3":@"迎新春事事如意"},@{@"name1":@"家和万事兴",@"name2":@"一年四季行好运",@"name3":@"八方财宝进家门"}];
NSDictionary *list1=list[arc4random()%3];
UILabel *lable=[[UILabel
alloc]initWithFrame:CGRectMake(107,
50,
200, 40)];
[self.window
addSubview:lable];
lable.backgroundColor=[UIColor
redColor];
lable.text=list1[@"name1"];
lable.font=[UIFont
boldSystemFontOfSize:36];
lable.textColor=[UIColor
blackColor];
lable.textAlignment=NSTextAlignmentCenter;
lable.textAlignment=NSTextAlignmentCenter;
UILabel *lable1=[[UILabel
alloc]initWithFrame:CGRectMake(50,
150, 50,
400)];
[self.window
addSubview:lable1];
lable1.backgroundColor=[UIColor
redColor];
lable1.text=list1[@"name2"];
lable1.font=[UIFont
boldSystemFontOfSize:36];
lable1.textColor=[UIColor
blackColor];
lable1.numberOfLines=7;
lable1.textAlignment=NSTextAlignmentCenter;
UILabel *lable2=[[UILabel
alloc]initWithFrame:CGRectMake(314,
150, 50,
400)];
[self.window
addSubview:lable2];
lable2.backgroundColor=[UIColor
redColor];
lable2.text=list1[@"name3"];
lable2.font=[UIFont
boldSystemFontOfSize:36];
lable2.textColor=[UIColor
blackColor];
lable2.numberOfLines=7;
lable2.textAlignment=NSTextAlignmentCenter;
}
#pragma mark--------第三题----------
-(void)first{
//imagView.alpha=0.01;
imagView=[[UIImageView
alloc]initWithFrame:CGRectMake(100,100
,300 ,300 )];
[self.window
addSubview:imagView];
imagView.image=[UIImage
imageNamed:@"0.tiff"];
}
alloc]initWithFrame:[UIScreen
mainScreen].bounds];
//makeKeyAndVisible让窗口是一个主窗口
并且显示在屏幕上
[self.window
makeKeyAndVisible];
ViewController *vc = [[ViewController
alloc]
init];
self.window.rootViewController = vc;
self.window.backgroundColor=[UIColor
whiteColor];
#pragma mark----------第一题--------
/* UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(107, 50, 200, 40)];
[self.window addSubview:lable];
lable.backgroundColor=[UIColor redColor];
lable.text=@"春色满园";
lable.font=[UIFont boldSystemFontOfSize:36];
lable.textColor=[UIColor blackColor];
lable.textAlignment=NSTextAlignmentCenter;
UILabel *lable1=[[UILabel alloc]initWithFrame:CGRectMake(50,150 ,50 ,400 )];
[self.window addSubview:lable1];
lable1.textAlignment=NSTextAlignmentCenter;
lable1.backgroundColor=[UIColor redColor];
lable1.text=@"大地歌唤彩云";
lable1.font=[UIFont boldSystemFontOfSize:36];
lable1.textColor=[UIColor blackColor];
lable1.numberOfLines=6;
UILabel *lable2=[[UILabel alloc]initWithFrame:CGRectMake(314, 150, 50, 400)];
[self.window addSubview:lable2];
lable2.textAlignment=NSTextAlignmentCenter;
lable2.backgroundColor=[UIColor redColor];
lable2.text=@"满园春关不住";
lable2.font=[UIFont boldSystemFontOfSize:36];
lable2.textColor=[UIColor blackColor];
lable2.numberOfLines=6;
//[self performSelector:@selector(start) withObject:nil afterDelay:5];
*/
//[NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(start) userInfo:nil repeats:YES];
#pragma mark-----第三题--------
// imagView=[[UIImageView alloc]initWithFrame:CGRectMake(100,100 ,300 ,300 )];
// [self.window addSubview:imagView];
// imagView.animationDuration=1;
// UIImage *a=[UIImage imageNamed:@"1.tiff"];//给动画准备图片素材
// UIImage *a1=[UIImage imageNamed:@"2.tiff"];
// UIImage *a2=[UIImage imageNamed:@"3.tiff"];
// UIImage *a3=[UIImage imageNamed:@"4.tiff"];
// UIImage *a4=[UIImage imageNamed:@"5.tiff"];
// UIImage *a5=[UIImage imageNamed:@"6.tiff"];
// UIImage *a6=[UIImage imageNamed:@"7.tiff"];
// UIImage *a7=[UIImage imageNamed:@"8.tiff"];
// UIImage *a8=[UIImage imageNamed:@"9.tiff"];
// UIImage *a9=[UIImage imageNamed:@"10.tiff"];
// UIImage *a10=[UIImage imageNamed:@"11.tiff"];
// UIImage *a11=[UIImage imageNamed:@"12.tiff"];
// UIImage *a12=[UIImage imageNamed:@"13.tiff"];
// NSArray *list=@[a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12];
// imagView.animationImages=list;
// imagView.animationRepeatCount=1;//0;//给动画设置次数
// [imagView startAnimating];
// [self performSelector:@selector(first) withObject:nil afterDelay:5];
#pragma mark---第四题--------
imagView=[[UIImageView
alloc]initWithFrame:CGRectMake(0,0
,414 ,736)];
[self.window
addSubview:imagView];
imagView.animationDuration=1;
UIImage *a=[UIImage
imageNamed:@"1.tiff"];//给动画准备图片素材
UIImage *a1=[UIImage
imageNamed:@"2.tiff"];
UIImage *a2=[UIImage
imageNamed:@"3.tiff"];
UIImage *a3=[UIImage
imageNamed:@"4.tiff"];
UIImage *a4=[UIImage
imageNamed:@"5.tiff"];
UIImage *a5=[UIImage
imageNamed:@"6.tiff"];
UIImage *a6=[UIImage
imageNamed:@"7.tiff"];
UIImage *a7=[UIImage
imageNamed:@"8.tiff"];
UIImage *a8=[UIImage
imageNamed:@"9.tiff"];
UIImage *a9=[UIImage
imageNamed:@"10.tiff"];
UIImage *a10=[UIImage
imageNamed:@"11.tiff"];
UIImage *a11=[UIImage
imageNamed:@"12.tiff"];
UIImage *a12=[UIImage
imageNamed:@"13.tiff"];
NSArray *list=@[a,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12];
imagView.animationImages=list;
imagView.animationRepeatCount=0;//0;//给动画设置次数
[imagView
startAnimating];
UILabel *lable=[[UILabel
alloc]init];
lable.frame=CGRectMake(50,
400, 100,
40);
lable.backgroundColor=[UIColor
whiteColor];
lable.text=@"用户名 ";
lable.textColor=[UIColor
redColor];
lable.font=[UIFont
systemFontOfSize:24];
lable.textAlignment=NSTextAlignmentCenter;
[self.window
addSubview:lable];
UILabel *lable1=[[UILabel
alloc]init];
lable1.frame=CGRectMake(200,
400, 200,
40);
lable1.backgroundColor=[UIColor
whiteColor];
[self.window
addSubview:lable1];
UILabel *lable2=[[UILabel
alloc]init];
lable2.frame=CGRectMake(50,
500, 100,
40);
lable2.backgroundColor=[UIColor
whiteColor];
lable2.text=@"密码 ";
lable2.textColor=[UIColor
redColor];
la
dd6f
ble2.font=[UIFont
systemFontOfSize:24];
lable2.textAlignment=NSTextAlignmentCenter;
[self.window
addSubview:lable2];
UILabel *lable3=[[UILabel
alloc]init];
lable3.frame=CGRectMake(200,
500, 200,
40);
lable3.backgroundColor=[UIColor
whiteColor];
[self.window
addSubview:lable3];
return
YES;
}
#pragma mark--------第二题----------
-(void)start{
NSMutableArray *list=@[@{@"name1":@"家庭幸福",@"name2":@"欢天喜地度佳节",@"name3":@"张灯结彩迎新春"},@{@"name1":@"好事临门",@"name2":@"迎新春事事如意",@"name3":@"迎新春事事如意"},@{@"name1":@"家和万事兴",@"name2":@"一年四季行好运",@"name3":@"八方财宝进家门"}];
NSDictionary *list1=list[arc4random()%3];
UILabel *lable=[[UILabel
alloc]initWithFrame:CGRectMake(107,
50,
200, 40)];
[self.window
addSubview:lable];
lable.backgroundColor=[UIColor
redColor];
lable.text=list1[@"name1"];
lable.font=[UIFont
boldSystemFontOfSize:36];
lable.textColor=[UIColor
blackColor];
lable.textAlignment=NSTextAlignmentCenter;
lable.textAlignment=NSTextAlignmentCenter;
UILabel *lable1=[[UILabel
alloc]initWithFrame:CGRectMake(50,
150, 50,
400)];
[self.window
addSubview:lable1];
lable1.backgroundColor=[UIColor
redColor];
lable1.text=list1[@"name2"];
lable1.font=[UIFont
boldSystemFontOfSize:36];
lable1.textColor=[UIColor
blackColor];
lable1.numberOfLines=7;
lable1.textAlignment=NSTextAlignmentCenter;
UILabel *lable2=[[UILabel
alloc]initWithFrame:CGRectMake(314,
150, 50,
400)];
[self.window
addSubview:lable2];
lable2.backgroundColor=[UIColor
redColor];
lable2.text=list1[@"name3"];
lable2.font=[UIFont
boldSystemFontOfSize:36];
lable2.textColor=[UIColor
blackColor];
lable2.numberOfLines=7;
lable2.textAlignment=NSTextAlignmentCenter;
}
#pragma mark--------第三题----------
-(void)first{
//imagView.alpha=0.01;
imagView=[[UIImageView
alloc]initWithFrame:CGRectMake(100,100
,300 ,300 )];
[self.window
addSubview:imagView];
imagView.image=[UIImage
imageNamed:@"0.tiff"];
}
相关文章推荐
- GUI - Web前端开发框架
- 评价ui设计作品好坏的八个标准(界面/交互设计研究)
- 为Yahoo! UI Extensions Grid增加内置的可编辑器
- Cocos2d-x UI开发之文本类使用实例
- 谈谈对jquery ui tabs 的理解
- 在IE 浏览器中使用 jquery的fadeIn() 效果 英文字符字体加粗
- UI Events 用户界面事件
- jquery UI Datepicker时间控件的使用方法(基础版)
- 基于jQuery UI CSS Framework开发Widget的经验
- jquery ui 1.7 ui.tabs 动态添加与关闭(按钮关闭+双击关闭)
- jQuery UI设置固定日期选择特效代码分享
- Jquery ajax 同步阻塞引起的UI线程阻塞问题
- jQuery UI的Dialog无法提交问题的解决方法
- jQuery ui实现动感的圆角渐变网站导航菜单效果代码
- jquery UI Datepicker时间控件的使用方法(终结版)
- jquery UI Datepicker时间控件的使用方法(加强版)
- 关于jQuery UI 使用心得及技巧
- jQuery ui 1.7更新小结
- 从零开始学习jQuery (十) jQueryUI常用功能实战
- jquery ui对话框实例代码