0

我的应用程序有 VOIP 呼叫。我想实现当用户点击拨号盘上的通话按钮和结束通话按钮上完成的动画时 iPhone 的默认电话应用程序所做的动画。

我对此进行了很多研究,但还没有找到任何东西。对此主题的任何帮助将不胜感激。

现在我已经实现了如下缩放动画:

- (void)animateFadingOut{

    self.view.transform = CGAffineTransformMakeScale(1.00, 1.00);
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationDelegate:self];

    [self performSelector:@selector(push) withObject:nil afterDelay:0.35];
    self.view.transform = CGAffineTransformMakeScale(0.00, 0.00);
    //set transformation
    [UIView commitAnimations];


}

- (void)push
{
    self.view.transform = CGAffineTransformMakeScale(1.00, 1.00);
    // push navigation controloller
    CallViewController *objCallViewController = [[CallViewController alloc] initWithNibName:@"CallViewController_iPhone" bundle:nil];
    [self setHidesBottomBarWhenPushed:YES];

    [self.navigationController pushViewController:objCallViewController animated:NO];
    [objCallViewController release];
    [self setHidesBottomBarWhenPushed:NO];
    [[AppDelegate shared] setTabHidden:TRUE];

}

但是它并没有给我默认电话应用程序具有的确切动画

4

2 回答 2

0

如果我尝试创建动画,这就是我可能会尝试的方法。

CGRect movementFrame = self.view.frame;
//Make position and size changes as needed to frame
movementFrame.origin.x = 0;

[UIView animateWithDuration:0.5
                      delay:0.0
                    options:UIViewAnimationOptionCurveEaseOut
                 animations:^{

                     /*
                       Animation you want to commit go here
                       Apply movementFrame info to the frame
                       of the item we want to animate
                     */

                     //If you wanted a fade
                     self.view.alpha = !self.view.alpha //Simply says I want the reverse.

                     self.view.frame = movementFrame;

                     //Example of what you could do.

                     self.view.transform =CGAffineTransformMakeScale(1.00, 1.00);

                 } completion:^(BOOL finished) {
                     //Things that could happen once the animation is finished
                     [self push];
                 }];

这尚未针对您的情况进行测试。因此,我也不确定它是否会帮助你,但希望它会。祝你好运。

*编辑*

所以我在 iPhone 上查看了动画,在我看来它是一系列同时发生的动画。

  • 你有我认为的 UIActionSheet 动画。
  • 顶部覆盖在其 y 轴上滑动。
  • 然后你有,我还没有掌握,在后视图中的一个分裂,它在相反的方向上动画它的 x 轴,导致分裂。
  • 最后,您可以放大新视图以获取效果。

    我不能说他们是如何做到的 100%,但是如果我要尝试重新创建它,我可能会从这里开始。

  • 于 2013-02-13T09:08:25.087 回答
    0

    您好,所以在快速制作动画后,我已经非常接近它可以使用一些调整。我花了三个视图来做一个 topView, bottomView, and backView. 还考虑到您将要加载的视图。viewToLoadIn

    `-(无效)动画{

    CGRect topMovementFrame = self.topView.frame; //Set dummy frame to modify 
    CGRect bottomViewFrame = self.bottomview.frame;
    topMovementFrame.origin.y = 0 - self.topView.frame.size.height; //modify frame's yAxis so that the frame sits above the screen.
    bottomViewFrame.origin.y = self.view.frame.size.height; //modify frame's yAxis to the it will sit at the bottom of the screen.
    
    [self.viewToLoadIn setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    
    
    [UIView animateWithDuration:0.5
                          delay:0.0
                        options:UIViewAnimationOptionCurveEaseOut
                     animations:^{
                         //Animation
                         self.topView.frame = topMovementFrame; //Commit animations
                         self.bottomview.frame = bottomViewFrame;
                         self.backView.alpha = !self.backView.alpha;
                         self.backView.transform = CGAffineTransformMakeScale(100, 100);
                         self.viewToLoadIn.transform = CGAffineTransformMakeScale(2.0, 3.0);
    
    
                          *MAGIC*
                     } completion:^(BOOL finished) {
                         //Completion
                         //Clean up your views that you are done with here.
                     }];
    

    }`

    所以当他们按下我设置的按钮时,这个动画就会发生。

    Also at first I thought that the setup might contain a UIActionStyleSheet. which it still might but this is a pretty handy built in functionality. But the fact that you can interact with the screen lead me to think a custom view. It would be easier in my opinion.

    I hope this helps you even if it just a little bit. Take care ^^

    于 2013-02-16T02:01:38.310 回答