开发者

Apply animation in specified UIView?

开发者 https://www.devze.com 2023-01-19 05:59 出处:网络
I want to make an animation like SwichView exa开发者_开发百科mple in \"Beginning iPhone development\". My animation code:

I want to make an animation like SwichView exa开发者_开发百科mple in "Beginning iPhone development". My animation code:

    [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];

Apply animation in specified UIView?

But i want my Toolbar don't "flip" with another view. I don't want it perform any animation. Can i do it?

Here is SwitchView example:

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


Try this with your view gor getting pop up animation

- (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"]; 
}


See TransitionViewController.m in Apple's UICatalog sample code.

0

精彩评论

暂无评论...
验证码 换一张
取 消