프로가 되자.

post search result

presentationLayer와 관련된 글 1개를 찾았습니다.

  1. 2009/03/25 UIView로 Animation시 실제 frame/bounds 값 얻어오기

UIView로 Animation시 실제 frame/bounds 값 얻어오기

UIView를 통해 animation을 수행하고 animation이 수행되는 중간 중간에 bounds나 frame값을 얻어오면 최종 좌표로 얻어오는 것을 볼 수 있습니다.

예를 들어 다음과 같은 코드를 실행한다면
[UIView beginAnimations:@"" context:nil];
[UIView setAnimationDuration:10.0f];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
CGRect bounds;
bounds = [self bounds];
bounds.origin.x += 100.0f;
[self setBounds:bounds];
[UIView commitAnimations];


10.0시간 동안 100.0만큼 오른쪽으로 움직입니다.
등속도로 설정 하였으니, 5.0시간이 지났을 경우 50.0만큼 오른쪽으로 이동하는 것을 볼 수 있습니다.
원래 x값이 13.0이라고 하였을 때 63.0이라는 값을 기대할 수 있겠죠.

그런데 이 때 [bounds] 값을 얻어오면 최종, 즉 x가 113.0을 나타내고 있습니다.
이러한 상황에서 실제 보여지는 좌표의 값을 얻어오기 위해서는 다음과 같은 값을 사용합니다.

[[[self layer] presentationLayer] bounds];


(컴파일 하면 warning이 나오는데 그냥 무시하세요 =ㅁ=)

출처:
크리에이티브 커먼즈 라이센스
Creative Commons License
2009/03/25 20:36 2009/03/25 20:36

top

About this post

이 글에는 아직 트랙백이 없고, 아직 댓글이 없고, , , 태그가 달려있으며,
2009/03/25 20:36에 작성되었습니다.

◀ recent : [1] : previous ▶

blog information

프로가 되자.
BLOG main image
빗소리를 먹는 사람.
RSS 2.0Tattertools
최근 글 최근 댓글 최근 트랙백
태그 구름사이트 링크