ios7 UIAnimation
来源:互联网 发布:淘宝上怎么找卖片的 编辑:程序博客网 时间:2024/06/05 10:58
//视图1
UIView *rootview01 = [[UIView alloc]init];
rootview01.tag = 101;
rootview01.frame = CGRectMake(0, 20, 320, 460);
rootview01.backgroundColor = [UIColor greenColor];
[self.window addSubview:rootview01];
[rootview01 release];
//视图1上的按钮
UIButton *btn01 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn01.frame =CGRectMake(100, 200, 80, 40);
[btn01 setTitle:@"视图一" forState:UIControlStateNormal];
[btn01 addTarget:self action:@selector(pressBtn01) forControlEvents:UIControlEventTouchUpInside];
[rootview01 addSubview:btn01];
//视图2
UIView *rootview02 = [[UIView alloc]init];
rootview02.tag = 102;
rootview02.frame = CGRectMake(320, 20, 320, 460);
rootview02.backgroundColor = [UIColor blueColor];
[self.window addSubview:rootview02];
[rootview02 release];
//视图2上的按钮
UIButton *btn02 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn02.frame =CGRectMake(100, 200, 80, 40);
[btn02 setTitle:@"视图二" forState:UIControlStateNormal];
[btn02 addTarget:self action:@selector(pressBtn02) forControlEvents:UIControlEventTouchUpInside];
[rootview02 addSubview:btn02];
//视图3
UIView *rootview03 = [[UIView alloc]init];
rootview03.tag = 103;
rootview03.frame = CGRectMake(0, -480, 320, 460);
rootview03.backgroundColor = [UIColor yellowColor];
[self.window addSubview:rootview03];
[rootview03 release];
//视图3上的按钮
UIButton *btn03 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn03.frame =CGRectMake(100, 200, 80, 40);
[btn03 setTitle:@"视图三" forState:UIControlStateNormal];
[btn03 addTarget:self action:@selector(pressBtn03)forControlEvents:UIControlEventTouchUpInside];
[rootview03 addSubview:btn03];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
-(void)pressBtn01
{
UIView *rootView01 = [self.window viewWithTag:101];
UIView *rootView02 = [self.window viewWithTag:102];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5];
rootView01.frame = CGRectMake(-320, 20, 320, 460);
rootView02.frame = CGRectMake(0, 20, 320, 460);
[UIView commitAnimations];
}
-(void)pressBtn02
{
UIView *rootView02 = [self.window viewWithTag:102];
UIView *rootView03 = [self.window viewWithTag:103];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5];
rootView02.frame = CGRectMake(0, 480, 320, 460);
rootView03.frame = CGRectMake(0, 20, 320, 460);
[UIView commitAnimations];
}-(void)pressBtn03
{
UIView *rootView03 = [self.window viewWithTag:103];
[rootView03 removeFromSuperview];
}
UIView *rootview01 = [[UIView alloc]init];
rootview01.tag = 101;
rootview01.frame = CGRectMake(0, 20, 320, 460);
rootview01.backgroundColor = [UIColor greenColor];
[self.window addSubview:rootview01];
[rootview01 release];
//视图1上的按钮
UIButton *btn01 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn01.frame =CGRectMake(100, 200, 80, 40);
[btn01 setTitle:@"视图一" forState:UIControlStateNormal];
[btn01 addTarget:self action:@selector(pressBtn01) forControlEvents:UIControlEventTouchUpInside];
[rootview01 addSubview:btn01];
//视图2
UIView *rootview02 = [[UIView alloc]init];
rootview02.tag = 102;
rootview02.frame = CGRectMake(320, 20, 320, 460);
rootview02.backgroundColor = [UIColor blueColor];
[self.window addSubview:rootview02];
[rootview02 release];
//视图2上的按钮
UIButton *btn02 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn02.frame =CGRectMake(100, 200, 80, 40);
[btn02 setTitle:@"视图二" forState:UIControlStateNormal];
[btn02 addTarget:self action:@selector(pressBtn02) forControlEvents:UIControlEventTouchUpInside];
[rootview02 addSubview:btn02];
//视图3
UIView *rootview03 = [[UIView alloc]init];
rootview03.tag = 103;
rootview03.frame = CGRectMake(0, -480, 320, 460);
rootview03.backgroundColor = [UIColor yellowColor];
[self.window addSubview:rootview03];
[rootview03 release];
//视图3上的按钮
UIButton *btn03 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn03.frame =CGRectMake(100, 200, 80, 40);
[btn03 setTitle:@"视图三" forState:UIControlStateNormal];
[btn03 addTarget:self action:@selector(pressBtn03)forControlEvents:UIControlEventTouchUpInside];
[rootview03 addSubview:btn03];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
-(void)pressBtn01
{
UIView *rootView01 = [self.window viewWithTag:101];
UIView *rootView02 = [self.window viewWithTag:102];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5];
rootView01.frame = CGRectMake(-320, 20, 320, 460);
rootView02.frame = CGRectMake(0, 20, 320, 460);
[UIView commitAnimations];
}
-(void)pressBtn02
{
UIView *rootView02 = [self.window viewWithTag:102];
UIView *rootView03 = [self.window viewWithTag:103];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.5];
rootView02.frame = CGRectMake(0, 480, 320, 460);
rootView03.frame = CGRectMake(0, 20, 320, 460);
[UIView commitAnimations];
}-(void)pressBtn03
{
UIView *rootView03 = [self.window viewWithTag:103];
[rootView03 removeFromSuperview];
}
- ios7 UIAnimation
- iOS UIAnimation动画总结
- swift基础之UIAnimation 动画(手势操作)
- iOS7
- iOS7
- ios7
- iOS7
- iOS7 Related
- ios7兼容
- iOS7 注意事项
- iOS7 状态栏
- ios7 状态栏
- ios7 状态栏
- ios7 StatusBar
- IOS7兼容问题
- iOS7 注意事项
- 适配ios7
- ios7适配
- Google C++编程规范:(三)类
- Bandwidthd+Postgresql数据库配置笔记
- Java Design Pattern: State
- WebService第二步 - 按规定的标准开发
- java数字保留2位小数
- ios7 UIAnimation
- openSSL使用手册
- JBMP中文乱码问题的解决方案
- 解决linux安装JDK时Error occurred during initialization of VM
- GNU汇编器 编写汇编函数 [李园7舍_404]
- Android提供的获取流量的方法
- 10247 - Complete Tree Labeling(递推高精度)
- java调用外部脚本或者程序,看了别人的代码,算是转载吧。
- C#学习(messageBox,pictureBox,窗口切换)