优雅的视图过渡动画?

时间:2012-02-23 03:34:35

标签: iphone animation uiview transition

我的观点如下:

enter image description here

我会显示一个这样的弹出窗口:

enter image description here

我尝试的每次转换看起来都像是一个廉价的黑客。 Apple在他们的应用程序商店中有一个类似的白色弹出窗口,它像一个警报视图一样弹跳,然后背景稍微消失。

我怎样才能达到这个效果?

现在我只是模糊它:

[previewView setAlpha:0.0];
    [[self.view.window.subviews objectAtIndex:0] addSubview:previewView];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1];
    [previewView setAlpha:1.0];
    [UIView commitAnimations];

它看起来很糟糕。

我真的不在乎动画是什么。我只是希望它看起来很专业。

1 个答案:

答案 0 :(得分:2)

查看我的answer

FTUtils有一个与你描述的完全相同的弹出式动画。

您也可以使用一行:

[myView popIn:0.35f delegate:self];

或弹出:

[myView popOut:0.35f delegate:self];