2012-09-11 3 views
4

블록에 setAnimationBeginsFromCurrentState을 설정해야합니다. 어떻게하는지에 대한 문서 나 예제를 찾을 수 없습니다.UIView 블록 기반 애니메이션 다시 그리기

나는이 변환해야합니다

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationBeginsFromCurrentState:YES]; //The problem 
[UIView setAnimationDuration:kKeyboardAnimationDuration]; 
[self.view setFrame:viewFrame]; 
[UIView commitAnimations]; 

setAnimationBeginsFromCurrentState 특성 블록으로뿐만 아니라 설정합니다.

답변

7

블록 기반 UIView 애니메이션을 사용하는 경우 UIViewAnimationOptionBeginFromCurrentState을 애니메이션 옵션에 전달할 수 있습니다.

[UIView animateWithDuration:1.0 delay:0.0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{ 
    [self.view setFrame:viewFrame]; 
}completion:^(BOOL done){ 
    //some completition 
}]; 
+0

아! 왜 나는 그것을 보지 못했습니다 : S 도움을 주셔서 감사합니다! – random

관련 문제