Home Ask Login Register

Developers Planet

Your answer is one click away!

Blackbird SR-71 February 2016

icarousel Vertical Scroll Effect on tableview with images

i am trying to apply iCarousel vertical type effect on tableview cell images. But not set vertical scroll effect. i also check this, https://github.com/nicklockwood/iCarousel but in this example only set horizontal scroll effect. and i want to set Vertical type effect. so , suggest me some good demo link or with proper code solution.

this is some code for that ...

- (CATransform3D)carousel:(iCarousel *)carousel itemTransformForOffset:(CGFloat)offset baseTransform:(CATransform3D)transform {

    const CGFloat centerItemZoom = 1.6;
    const CGFloat centerItemSpacing = 1.5;

    CGFloat spacing = [self carousel:carousel valueForOption:iCarouselOptionSpacing withDefault:1.0f];
    CGFloat absClampedOffset = MIN(1.0, fabs(offset));
    CGFloat clampedOffset = MIN(1.0, MAX(-1.0, offset));
    CGFloat scaleFactor = 1.0 + absClampedOffset * (1.0/centerItemZoom - 1.0);
    offset = (scaleFactor * offset + scaleFactor * (centerItemSpacing - 1.0) * clampedOffset) * carousel.itemWidth * spacing;

    if (carousel.vertical)
        transform = CATransform3DTranslate(transform, 0.0f, offset, -absClampedOffset);
        transform = CATransform3DTranslate(transform, offset, 0.0f, -absClampedOffset);

    transform = CATransform3DScale(transform, scaleFactor, scaleFactor, 2.0f);

    return transform; 

but not work for my requirement. Thank x in advance


Vijay Palwe February 2016

if you want vertical scroll add this in your code

    self.carousel.vertical = !self.carousel.vertical;

Post Status

Asked in February 2016
Viewed 3,311 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life