【问题标题】:Blur back Images in ICarousel在 ICarousel 中模糊图像
【发布时间】:2015-12-16 11:21:22
【问题描述】:

我在我的应用程序中使用iCarouselTypeCoverFlow 库。我想模糊后面的图像。

我能够模糊 viewForItemAtIndex 中的图像。但是在滚动时我无法更新。这是我的viewForItemAtindex代码

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index
{

    image = [items objectAtIndex:index];

    button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, image.size.width, image.size.height)];

    [button setBackgroundImage:image forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    button.titleLabel.font = [button.titleLabel.font fontWithSize:50];
    button.tag=index;

    //NSLog(@"%d %d",carousel.currentItemIndex,index);
    if (selectedindex == index) {

        [button setBackgroundImage:[items objectAtIndex:index] forState:UIControlStateNormal];

    }
    else {

        [button setBackgroundImage:[self blurredImageWithImage:[items objectAtIndex:index]] forState:UIControlStateNormal];

    }

    return button;

}

这是我的文档

- (void)carouselDidScroll:(iCarousel *)carousel
{
    NSInteger current = (carousel.currentItemIndex);
   // NSLog(@"%d", current);


    NSInteger nextIndex = (carousel.currentItemIndex + 1) % carousel.numberOfItems;
   // NSLog(@"%d", nextIndex);



    NSInteger prevIndex = (carousel.currentItemIndex + carousel.numberOfItems - 1) % carousel.numberOfItems;
   // NSLog(@"%d", prevIndex);


}

任何建议或帮助将不胜感激。

【问题讨论】:

    标签: ios objective-c scroll icarousel


    【解决方案1】:

    所以我终于得到了答案。绝对不希望这样。但不幸的是,答案是,

    nicklockwood answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-09-28
      • 2015-06-10
      • 1970-01-01
      • 2014-06-13
      • 2015-09-19
      • 2019-02-02
      • 2019-05-13
      • 1970-01-01
      相关资源
      最近更新 更多