项目介绍:
仿格瓦拉电影页面切换动画
仿格瓦拉电影的页面切换特效,包含present-dismiss 和push-pop 2个组合的效果。
主要代码:
[Objective-C] 查看源文件 复制代码
- (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor grayColor]; // Do any additional setup after loading the view, typically from a nib. // 设置代理 self.trans = [[LawageTrans alloc] init]; self.navigationController.delegate = self.trans; self.transitioningDelegate = self.trans; self.btn = [UIButton buttonWithType:UIButtonTypeSystem]; self.btn.frame = CGRectMake(0, 0, 100, 100); self.btn.backgroundColor = [UIColor redColor]; self.btn.center = self.view.center; [self.btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.btn]; UIButton *bbb = [UIButton buttonWithType:UIButtonTypeSystem]; bbb.frame = CGRectMake(100, 100, 100, 100); [bbb addTarget:self action:@selector(bbbbBtnClick) forControlEvents:UIControlEventTouchUpInside]; bbb.backgroundColor = [UIColor greenColor]; [self.view addSubview:bbb]; } - (void)btnClick { ViewController1 *vc = [[ViewController1 alloc] init]; [self presentViewController:vc animated:YES completion:nil]; } - (void)bbbbBtnClick { ViewController1 *vc = [[ViewController1 alloc] init]; [self.navigationController pushViewController:vc animated:YES]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. }
lawage.zip
(33.17 KB, 下载次数: 396)
2016-9-2 15:38 上传
点击文件名下载附件
推荐:每周iOS精选推送