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

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

我该怎么做?

最佳答案

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

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"];

关于ios - 如何在Xcode中创建动画过渡屏幕,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23426800/

10-13 04:03