2011-09-13 5 views
0

나는 scrollView를 가지고 있으며이 스크롤 뷰 안에 4 개의 이미지가 있습니다. 페이징이 활성화되었습니다. 하지만이 이미지를 무작위로 스크롤하는 IBAction을하고 싶습니다. 어떻게해야합니까?IOS : 페이징 랜덤이있는 scrollView

답변

0
#define numPages 4 

CGRect frame = scrollView.frame; 
frame.origin.x = frame.size.width * (arc4random() % (numPages - 1)); 
frame.origin.y = 0; 
[scrollView scrollRectToVisible:frame animated:YES]; 
0

유용 할 수 있습니다. 모든 시간은 contentoffset

[scrollView contentOffset:CGSizeMake(totalscrollviewwidth,480]; 

을 변경하고 링크에서이 link 또한

+0

모습을 찾을 수 – Tendulkar