2

押すとView Controllerを押すボタンがありますが、カスタムアニメーションを使用しているためpushViewController: childController animated:、NOに設定されています。私がやりたいことは、私の- (void)viewWillAppear:(BOOL)animatedメソッドでこのカスタム アニメーションを検出し、このような if ステートメントを書くことです。

- (void)viewWillAppear:(BOOL)animated { 
     if (customAnimation occured) {//Do this} 
     else {//Do this}
}

これは、View Controller をプッシュするボタンのメソッドです。

- (void)nextPressed:(id)sender {
    childController = [[CategoryOneDetailController alloc] initWithNibName:xibDownName bundle:nil];
    [UIView  beginAnimations: @"Showinfo"context: nil];
    [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.75];
    [self.navigationController pushViewController: childController animated:NO];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.navigationController.view cache:NO];
    [UIView commitAnimations];
    [childController release];
}

どんな助けでも大歓迎です、ありがとう、サミ。

4

1 に答える 1

1

標準のアニメーションを使用しない場合、最善の策はYES、カスタムアニメーションの場合に設定されている、プッシュされたView Controllerにプロパティを追加することです(NOデフォルトでは、既存の動作を壊さないようにします)。次に、でそのプロパティを確認できますviewDidAppear:

アニメーションの実行後にカスタムロジックを実行する必要がある場合は、アニメーション完了ハンドラーまたはブロックを設定することをお勧めします。

于 2011-06-23T08:37:23.127 に答える