2010-10-11 29 views
1

我想在「開始iPhone開發」中製作一個像SwichView示例的動畫。我的動畫代碼:在指定的UIView中應用動畫?

[UIView beginAnimations:@"View Flip" context:nil]; 
    [UIView setAnimationDuration:1.25]; 
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; 

    [UIView setAnimationTransition: 
    UIViewAnimationTransitionFlipFromRight 
          forView:self.view cache:YES]; 

    [blueViewController viewWillAppear:YES]; 
    [yellowViewController viewWillDisappear:YES]; 
    [blueViewController.view removeFromSuperview]; 
    [self.view insertSubview:yellowViewController.view atIndex:0]; 
    [yellowViewController viewDidDisappear:YES]; 
    [blueViewController viewDidAppear:YES]; 

    [UIView commitAnimations]; 

alt text

但我想我的工具欄不「炫」與另一種觀點。我不希望它執行任何動畫。我可以做嗎?

這裏是通過SwitchView例如:

http://www.mediafire.com/?lirh0ydcy6c2f9d

回答

0

見在蘋果的UICatalog示例代碼TransitionViewController.m

+0

感謝您的幫助:) – 2010-10-11 06:12:34

+0

沒有概率的,但如果這個回答你的問題,你應該投上一票,並單擊對號接受的答案。 – Nimrod 2010-10-11 17:16:32

1

嘗試對你的看法GOR越來越彈出動畫

- (void)doPopInAnimationWithDelegate 
{ 
CALayer *viewLayer = appDelegate.objSplitView.view.layer; 
CAKeyframeAnimation* popInAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; 
popInAnimation.duration = 0.5; 
popInAnimation.values = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.6], [NSNumber numberWithFloat:1.1], [NSNumber numberWithFloat:.9], [NSNumber numberWithFloat:1], nil]; 
popInAnimation.keyTimes = [NSArray arrayWithObjects: [NSNumber numberWithFloat:0.0], [NSNumber numberWithFloat:0.4], [NSNumber numberWithFloat:0.8], [NSNumber numberWithFloat:1.0], nil]; 
[viewLayer addAnimation:popInAnimation forKey:@"transform.scale"]; 
}