방법 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];
댓글 없음:
댓글 쓰기