2

フェードインする2つのUIImageViewを制御するUIViewControllerがあります。

次のように、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 に答える