0

私のxibファイルで設定したツールバーのUIButtonが押されたときに、新しいコントローラーがビューに読み込まれるようにしようとしています。

どうすればそれを実装できますか? FlipViewController を複製しようとしましたが、これらを複数持つことはできないと思います。

4

1 に答える 1

1
  1. iPad (画面全体に UINavigationController を使用しないでください)。

次のような素敵なアニメーションで切り替えることができます: ( でコメントされている行を変更しない限り、 app-delegate でのみ機能し// works only in app delegateます。

UIViewController *ctrl = [[UIViewController alloc] initWithNibName:@"someXIBStuff" bundle:nil];


    CAKeyframeAnimation *theAnimation = [CAKeyframeAnimation animation];
    theAnimation.values = [NSArray arrayWithObjects:
                           [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.12,1.12,1)],
                           [NSValue valueWithCATransform3D:CATransform3DMakeScale(1,1,1)],
                           nil];
    theAnimation.cumulative = YES;
    theAnimation.duration = 0.3;
    theAnimation.repeatCount = 0;
    theAnimation.removedOnCompletion = YES;


    theAnimation.timingFunctions = [NSArray arrayWithObjects:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn], 
                                    nil
                                    ];

    [self.window.layer addAnimation:theAnimation forKey:@"transform"];  

    CATransition *transition = [CATransition animation];
    transition.duration = 0.3;
    transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    transition.type = kCATransitionFade;
    transition.delegate = self;

    [self.window.layer addAnimation:transition forKey:nil]; 

    self.window.rootViewController = ctrl; // works only in app delegate
    [ctrl release];
  1. iPhone: UINavigationControllerを使用します(可能な場合)。そうでない場合は、上記の例を使用できます。
于 2012-04-12T18:48:55.977 に答える