2011-07-27 3 views
3

애니메이션 UIImage를 화면 전체로 이동하고 싶습니다. 이것이 어떻게 가능한지? U가 원하는 목적지화면을 통해 움직이는 UIImage를 어떻게 움직일 수 있습니까?

다음
-(void)doAnimate:(CGRect)rect{ 


    [UIView animateWithDuration:2.0 delay:0.5 options:UIViewAnimationCurveEaseInOut animations:^() { 


     self.myImageWalk.frame=rect; 


    } completion:^(BOOL finished) { 

     NSLog(@"animation Done"); 
    }]; 


} 

전화

self.myImageWalk.animationImages = [NSArray arrayWithObjects:[UIImage imageNamed:@"img01.png"],[UIImage imageNamed:@"img02.png"], [UIImage imageNamed:@"img03.png"], [UIImage imageNamed:@"img04.png"], nil]; 

[self.myImageWalk setAnimationRepeatCount:5]; 
[self.myImageWalk setAnimationDuration:2]; 
[self.myImageWalk startAnimating]; 

답변

3

선언이 기능 .H 파일

-(void)doAnimate:(CGRect)rect; 

하는 .m 파일 : 여기

지금까지있는 UIImage 애니메이션 내 코드입니다 애니메이션하기

 [self doAnimate:CGRectMake(300, 300, self.myImageWalk.frame.size.width, self.myImageWalk.frame.size.height)]; 

여기에서 다양한 위치로 움직이기를 원하는 ur에 300,300을 변경합니다.

+0

재미가 있습니다 ........ –

+0

인스턴트 도움말 http://chat.stackoverflow.com/rooms/682/conversation/do-u-want-instant-help-for-ur-question- or-ru-new-bee-to-iphone-ipad-develop –

관련 문제