2013-06-12 3 views

답변

1

이미 많은 답변이 게시되어 있습니다. 이 경우, CATransition 만 사용하려는 경우

CATransition *animation = [CATransition animation]; 
[animation setType:kCATransitionMoveIn]; 
[animation setSubtype:kCATransitionFromTop]; 
[animation setDuration:0.6f]; 
[animation setTimingFunction:[CAMediaTimingFunction functionWithName: 
           kCAMediaTimingFunctionEaseInEaseOut]]; 
[subview.layer addAnimation:animation forKey:@"someTransition"]; 
+0

내가 어떻게 dismissmodalviewcontroller의 동일한 애니메이션으로 이것을 제거 할 수 있는지 알려주십시오. – hacker

1

이 링크

  1. Link1
  2. Link2
  3. Link 3

내가이 세계에 법과 희망을 확인 더 많은 정보를 위해이 코드

[self.view bringSubviewToFront:yoursubview]; 
CATransition *animation = [CATransition animation]; 
[animation setType:kCATransitionFade]; 
[animation setDuration:1.00]; 
[animation setTimingFunction:[CAMediaTimingFunction functionWithName: 
           kCAMediaTimingFunctionEaseIn]]; 
[yoursubview.layer addAnimation:animation forKey:@"fadeTransition"]; 

시도 당신을위한 ks.

1

변경 께 UIView 애니메이션 INSITE 하위 뷰의 프레임을 다음과 같이 초기

subView.frame=CGRectMake(0,self.view.frame.size.height,your_width,your_height); 

다음 애니메이션

[UIView animateWithDuration:0.25 delay:0 options: UIViewAnimationCurveEaseOut animations:^ { 

     // set subView's frame 

    } completion:^(BOOL finished) { 

    } 
    ]; 
1

시도 내부 필요한 프레임 위치 세트

UIView 애니메이션 블록 사용 :

yourView.frame = CGRectMake(0, yourSuperView.frame.size.height, yourView.frame.size.width, yourView.frame.size.height); 
[yourSuperView addSubview:yourView]; 
[UIView animateWithDuration:1.0 animations:^{ 
    yourView.frame = CGRectMake(0, 0, yourView.frame.size.width, yourView.frame.size.height); 
} completion:^(BOOL finished) { 
    //Task to do on Animation completion. 
}]; 

설득력에 따라 애니메이션 기간을 변경합니다. 또한 당신은 다음과 같은 사용할 수 있습니다

[UIView animateWithDuration:1.0 animations: { 
     //your Implemntation 
}]; 

또는

[UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationCurveEaseIn animations:^{ 

} completion:^(BOOL finished) { 

}]; 

UIViewAnimationOptions 섹션과 방법을 구체적으로 애니메이션 옵션에 대한 UIView class reference을 확인하시기 바랍니다.

희망이 있습니다.

관련 문제