如何在xcode中创建动画过渡画面

时间:2014-05-02 11:14:32

标签: ios animation

我只是IOS的新人。这是我的应用程序的故事板:

 storyboard of my app

我制作了一个动画文件* gif,我想在ViewController 1ViewController 2之间添加它。这是怎么回事: 当我点击VC1上的按钮时,将显示动画屏幕(类似于加载屏幕),之后将显示视图2。

我该怎么做?

1 个答案:

答案 0 :(得分:0)

使用这个似乎接近你的问题

CATransition *animation = [CATransition animation];
    [animation setDuration:2];
    [animation setType:kCATransitionPush];
    [animation setSubtype:kCATransitionFromBottom];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];      ECAddToFavoriteViewController *addTofav = [[ECAddToFavoriteViewController alloc]initWithNibName:@"ECAddToFavoriteViewController" bundle:nil];
    [self.navigationController pushViewController:addTofav animated:YES];
    [[self.view layer] addAnimation:animation forKey:@"SwitchToView1"];