Developer/iOS

UIScrollView에서 스크롤의 위치를 옮겨주는 방법

블로blow 2010. 11. 13. 17:37
728x90

setContentOffset을 이용해서 스크롤의 위치를 옮겨줄수 있다.
[scroller setContentOffset:CGPointMake(0.0f, 0.0f) animated:NO];


Document
setContentOffset:animated:
Sets the offset from the content view’s origin that corresponds to the receiver’s origin.

- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated
Parameters
contentOffset
A point (expressed in points) that is offset from the content view’s origin.
animated
YES to animate the transition at a constant velocity to the new offset, NO to make the transition immediate.
728x90