如何设置成长效果在该视图中播放视频?

时间:2011-12-16 12:32:07

标签: objective-c ios cocoa-touch ipad core-animation

我想在iPad上创建一个应用程序。喜欢iTunes中的“Showyou”

为此我需要在用户触摸视频thumnail图像时设置视图的成长效果,并在用户触摸视图外部时使用动画隐藏,就像在ipad中使用popover一样。

1 个答案:

答案 0 :(得分:0)

我没有使用过ShowYou应用程序,但似乎需要一个动画来增大/缩小视图并可能移动它。如果是这样的话,试试这个

// to make it grow in this case 1.5 and move it to a into position in this case 100, 100
[UIView animateWithDuration:_animationDuration
                 animations:^{
                     CGAffineTransform transform = CGAffineTransformMakeScale(1.5f, 1.5f);
                     testView.transform = CGAffineTransformTranslate(transform, 100.0f, 100.0f);
                 }
];


// make it go back
[UIView animateWithDuration:_animationDuration
                 animations:^{
                     someView.transform = CGAffineTransformIdentity;
                 }
];

您可能希望使用animateWithDuration:delay:options:animations:completion:这样您就可以在动画完成后添加代码来执行某些操作。希望这就是你要找的东西。 :)