标签:ios customsegue 自定义动画
原创Blog,转载请注明出处
http://blog.csdn.net/hello_hwc?viewmode=contents
实现方式就是继承UIStoryboardSegue类,然后重写Perform方法,然后在Storyboard上将类设置为自定义的类
这段代码的作用是创建从中心渐变充满屏幕的动画
-(void)perform{ UIViewController * svc = self.sourceViewController; UIViewController * dvc = self.destinationViewController; [svc.view addSubview:dvc.view]; [dvc.view setFrame:svc.view.frame]; [dvc.view setTransform:CGAffineTransformMakeScale(0.1, 0.1)]; [dvc.view setAlpha:0.0]; [UIView animateWithDuration:1.0 animations:^{ [dvc.view setTransform:CGAffineTransformMakeScale(1.0, 1.0)]; [dvc.view setAlpha:1.0]; } completion:^(BOOL finished) { // [dvc.view removeFromSuperview]; }]; }最后的示意
完整的Demo工程
http://pan.baidu.com/s/1qWodA7E
标签:ios customsegue 自定义动画
原文地址:http://blog.csdn.net/hello_hwc/article/details/42212023