How to implement a uiscrollview with some small images?
Hi,
With some small images, I'm attempting to implement a uiscrollview.
I require that uiscrollview's last picture in every end stay in the center when scroll stops, leaving one part empty.
Now, last picture remain in the areas when scroll ends.
I have to know which picture is in the middle of the scroll view, and I want to use a shadow on it.
jugadorSlide.pagingEnabled = YES;
NSError *error = nil;
fotosJugadores = [[NSFileManager defaultManager] contentsOfDirectoryAtPath: @"/Users/exular/Developer/GBC/exular/GBC/Caras/" error: &error];
NSInteger numberOfViews = [fotosJugadores count];
for (int i = 0; i < numberOfViews; i++) {
UIImage *myImage = [UIImage imageNamed:[fotosJugadores objectAtIndex:i]];
CGFloat yOrigin = i * myImage.size.width;
UIImageView *awesomeView = [[UIImageView alloc] initWithFrame:CGRectMake(yOrigin, 0, myImage.size.width, myImage.size.height)];
awesomeView.alpha = 0.5;
awesomeView.image = myImage;
[self.jugadorSlide addSubview:awesomeView];
awesomeView=nil;
}
jugadorSlide .contentSize = CGSizeMake(65 * numberOfViews,78);
jugadorSlide.layer.cornerRadius = 11;
jugadorSlide.layer.masksToBounds = YES;
Please help me to do this.
Thanks.