2011-09-08 8 views
-1

버튼 클릭시 UITableVIew를 뷰 (뷰를 뷰 컨트롤로 이동하는 것이 아니라)로 슬라이드 한 다음 클릭하여 슬라이딩하여 뒤로 숨기려고합니다. 동일한 버튼의 tableView를 현재보기 내에서 슬라이드 시키길 원합니다.뷰에서 UITableView 애니메이션하기 - 뷰에서 UITableView 애니메이션하기

+3

전혀 시도하지 않으셨습니까? 보기를 화면으로 이동시키고 이동시킨 다음 실행하는 애니메이션 블록을 작성해보십시오. 애니메이션 작업을 생각할 때 가장 먼저해야 할 일은 [애니메이션보기]입니다 (http://developer.apple.com/library/iOS/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/AnimatingViews/AnimatingViews.html#//apple_ref/doc/uid/TP40009503-CH6-SW1)이 작동합니다. – darvids0n

답변

3

당신은 다시 화면이 떨어져 그것을 이동하는 테이블 뷰의 프레임 속성에 애니메이션이나 화면에. 당신은 UIView documentation이 같은 애니메이션 블록에 대해 읽을 수 있습니다

[UIView beginAnimations:nil context:nil]; 
[UIView setAnimationDuration:kSlideTableDuration]; 
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; 
[UIView setAnimationDelegate:self]; 
[UIView setAnimationDidStopSelector:@selector(tableAnimationDidStop:finished:context:)]; 

self.tableView1.frame = offScreen; 
self.tableView2.frame = onScreen; 

[UIView commitAnimations];      

: 여기

테이블 화면을보고 이동하고 그 자리에 화면에 다른 이동 일부 샘플 코드입니다.

0

UINavigationController을 사용하면 멋진 슬라이드 애니메이션을 무료로 얻을 수 있습니다. 슬라이딩 뷰를 처리하고 (네비게이션 컨트롤러 스택에 밀어 넣기), 슬라이딩 아웃 (네비게이션 컨트롤러 스택에서 튕겨 내림) 할 것입니다.

1

UINavigationController의 설명서를 확인하십시오. 이 비슷한을 할 것 구현하려면 : 당신의 CustomViewController 함께 할 때

iPhoneCustomViewController *newView = [[iPhoneCustomViewController alloc] initWithNibName:@"iPhoneCustomViewController" bundle:nil]; 
[self.navigationController pushViewController:newView animated:YES]; 
[newView release]; 

그런 다음을 수행하십시오

[self.navigationController popViewControllerAnimated:YES]; 
관련 문제