2014년 2월 21일 금요일

Animation 2


방법 1)

    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:0.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
                           forView:newView
                             cache:YES];
    [containerView setHidden:NO];
    [containerView addSubview:newView];
    [UIView commitAnimations];


방법 2)
    [UIView transitionWithView: containerView duration:0.5
                       options:UIViewAnimationOptionCurveEaseInOut 
                    animations:^ {
                        [containerView addSubview:newView];
                    } completion:nil];



방법 3)
CATransition *animation = [CATransition animation];
[animation setDuration:0.2];
[animation setType:kCATransitionMoveIn];
[animation setSubtype:kCATransitionFromRight];
    [newView.layer addAnimation:animation forKey:nil];
    [containerView addSubview:newView];

remove subview

CATransition *animation = [CATransition animation];
            [animation setDuration:0.5];
            [animation setType:kCATransitionReveal];
            [animation setSubtype:kCATransitionFromLeft];
            [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
            [[_refMenuContainerView layer] addAnimation:animation forKey:@"SlideView"]; //@"SwitchToNewView" , kCATransition ,,,,
            

            [subview removeFromSuperview];

댓글 없음:

댓글 쓰기