iCarousel space 轮播项目和在后台隐藏项目

iCarousel space the carousel items and Hide the items in the background

我正在考虑使用 iCarouselTypeRotary。我想要 space 这些项目,以便它们之间存在 x 值的差距,而且还隐藏了不是前 3 个视图的视图。

我试过了

- (CGFloat)carousel:(iCarousel *)_carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value
{
//customize carousel display
    switch (option)
    {
        case iCarouselOptionShowBackfaces:
            return NO;
        case iCarouselOptionSpacing:
        {
            //add a bit of spacing between the item views
            return value * 1.2f;
        }
         default:
        {
        return value;
        }
    }
}

但这只是 space 的视图,它不会隐藏背景项目。

非常感谢

You have add one more case in your switch case for only visible 3 views at a time and remaining will be invisible

- (CGFloat)carousel:(iCarousel *)_carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value
{
//customize carousel display
    switch (option)
    {
        case iCarouselOptionShowBackfaces:
        {
            return NO;
        }
        case iCarouselOptionSpacing:
        {
            //add a bit of spacing between the item views
            return value * 1.2f;
        }
        case iCarouselOptionVisibleItems:
        {
           return 3;
        }
        default:
        {
            return value;
        }
    }
}