nicklockwood/iCarousel — Issue #89: Like to show iCarousel Center Image in a separate UIImage
Author: ghousesgb
Created: 2012-02-16 17:41:15+00:00
State: open

Hi Nick,

I am using iCarousel Type as Coverflow with 3 visible items, and try to display center displayed image, just below it using UIImageView, but it is not working,

I mean to say, if we have 1 2 3 images, i would like to show image 2 just below the iCarousel object
2

the image 3 is displayed.

i am using the following method to handle this (plz refer items array for carousel and itemsSTImages array for below image.

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
//create new view if no view is available for recycling
NSString *imgName = [items objectAtIndex:index];
view = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:imgName]] autorelease];
if(index <= 0 || index>10)
index=9;
else
index--;

imgName = [itemsSTImage objectAtIndex:index];
productImageView.image = [UIImage imageNamed:imgName];

return view;
}
i have added if condition. this code works good when scrolling from right to left. but issue with mismatching of images when scrolled from left to right.

without if condition block, the effect of showing icarousel and image, matches good if we have single image in coverflow.