iCarousel
iCarousel copied to clipboard
Make only center view highlighted other nearest view dark
This is not an issue, but a request for help
I want except for the middle view, the other have an dark mask layer and according to the offset gradient.How should i achieve it?
Thanks for you anyway.
-(void)carouselDidScroll:(iCarousel *)carousel { for(UIView *view in carousel.visibleItemViews) { if(view == carousel.currentItemView) { view.alpha = 1 - (carousel.scrollOffset - carousel.currentItemIndex)>0.4?1 - (carousel.scrollOffset - carousel.currentItemIndex):1; } else { view.alpha = 0.4 + (carousel.scrollOffset - carousel.currentItemIndex)>0.4?0.4 + (carousel.scrollOffset - carousel.currentItemIndex):0.4; } } }