2

我有一个 UIViewController 应该控制 2 个 UIImageViews 淡入。

我设法使用 UIView animateWithDuration 方法为它们设置动画,如下所示:

[UIView animateWithDuration:1.5
    animations:^{
      [mFrontpageTitle setAlpha:0];
      [mFrontpageTitle setAlpha:1];
    }
    completion:^(BOOL finished){
      [self AnimatePause];
    }];

-(void)AnimatePause {
[UIView animateWithDuration:5.0
    animations:^{
      [mFrontpageTitle setAlpha:0.99];
      [mFrontpageTitle setAlpha:1];
    }
    completion:^(BOOL finished){
      [self AnimateAuthor];
    }];

触发下一个动画。现在,创建从 .99 到 1.0 的过渡并不是很干净。

有没有更好的方法来通过定义持续时间来触发块或发送消息?

谢谢

祖帕

4

1 回答 1

3
NSTimeInterval delay = 1.5; //in seconds
[self performSelector:@selector(myMethod) withObject:nil afterDelay:delay];
于 2011-08-21T10:07:28.173 回答