2011-01-28 5 views
0

UIScrollView (scrollView) 내에서 하위 뷰인 UITextView (myTextView)에 애니메이션을 적용하려고합니다.하위 뷰인 UITextView에 애니메이션을 적용하는 방법은 무엇입니까?

[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:1]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:myTextView cache:YES]; 
[scrollView addSubview:myTextView]; 
[UIView commitAnimations]; 

myTextView가 애니메이션없이 나타납니다.

+0

'addSubview :'는 아무것도 자체적으로 움직이지 않습니다. 텍스트보기를 정확히 표시하려면 어떻게합니까? – BoltClock

+0

textview가 UIViewAnimationTransitionCurlDown과 함께 나타나길 원합니다. 어떻게해야합니까? – JTheIslander

답변

1

어떤 종류의 애니메이션을 원하십니까? 예를 들어, 페이드 인하려면,해야만합니다.


[scrollView addSubview:myTextView]; 
myTextView.alpha = 0.0; 
[UIView beginAnimations:nil context:NULL]; 
[UIView setAnimationDuration:1]; 
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:myTextView cache:YES]; 
myTextView.alpha = 1.0; 
[UIView commitAnimations]; 

애니메이션을 만들기 위해 여러 속성 (예 : 프레임, 변형)을 변경할 수 있습니다.

+0

페이드 인이 훌륭하게 작동합니다. 감사합니다 .-) TextView를 UIViewAnimationTransitionCurlDown과 함께 표시하려면 어떻게해야합니까? – JTheIslander

0

http://www.4shared.com/dir/-PGqZEXR/zoominzoomout.html 당신의 프로젝트에이 파일을 추가하고 호출이 함수를 통해

여기 IM2가있는 UIView이며, 지금이 첨부 내가 그것을 다음이

- (void)viewDidLoad { 
    [self loadFlowersInView:im2]; 
    [self.view addSubview:im2]; 
} 

처럼보기 didload 통해 전달에 이미지를 붙여 함수는 다음과 같습니다.

- (void) loadFlowersInView: (UIView *) backdrop { 
     NSString *create_button = nil; // Add the flowers to random points on the screen 
     for (int i = 0; i < 1; i++) { 
      MagPicAppDelegate *appdelegate = (MagPicAppDelegate *)[[UIApplication sharedApplication] delegate]; 
      NSString *whichFlower = appdelegate.imageName; 
      UIImage *stemp = [UIImage imageNamed:@"approve.png"]; 
      DragView *dragger = [[DragView alloc] initWithImage:stemp]; 
      dragger.userInteractionEnabled = YES; 
      dragger.center = CGPointMake(160.0f, 140.0f); 
      [im2 addSubview:dragger]; 
      [dragger release]; 
     } 

     [self.view addSubview:im2]; 
     [im2 release]; 
} 
관련 문제