2013-10-29 7 views
0

배열에 여러 이미지가 있고 scrollView 모든 이미지가 자동으로 스크롤해야하며 이미지를 클릭하면 다른보기로 이동하여 세부 정보를 표시해야합니다. 다시 애니메이션 0으로, 즉 첫번째 이미지를로드한다 0에서 배열의 마지막에 스크롤 이미지를 완료 한 후 나는 자동으로 이미지를 스크롤

스피

[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; 

- (void) onTimer { 

    // Updates the variable h, adding 100 (put your own value here!) 
    h += 100; 

    //This makes the scrollView scroll to the desired position 
    yourScrollView.contentOffset = CGPointMake(0, h); 

} 
+0

이렇게하면 http://iosdevelopertips.com/user-interface/creating-circular-and-infinite-uiscrollviews.html을 도울 수 있습니다. –

답변

0

시도는이 코드를 사용하여 .... 문제의 많은 저를 도와주세요이 iCarousel library 이미지를 스크롤하려면 참조에 자동 스크롤 예제를 사용하고 루프에서 내용을 반복하려면 wrap 속성을 yes로 설정하십시오. 이미지 배열을 캐 러셀에 추가하고 캐 러셀 데이터 소스를 구현하고 이미지 스크롤을위한 메소드를 위임합니다. 당신은

0

당신이있어 그

NSMutableArray *imgArray = [[NSMutableArray alloc]init]; 
    for (int i =0; i<imgUrlArray.count; i++) { 
     NSString *imgStr = [serviceImgArray objectAtIndex:i]; 
     NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imgStr]]; 
     [imgArray addObject:[UIImage imageWithData:imageData]]; 
    } 
    yourimageView.animationImages = imgArray; 
    yourimageView.animationDuration = 10; 
    [yourimageView startAnimating]; 

후 이미지 콘센트를 만들 수 있습니다 회전, 직선과 같은 다른 유형을 변경하거나 등 넘칠 수 있습니다.

관련 문제