There are various ways to achieve this. The answers of carousel:itemAlphaForOffset: that you have already received are a good approach, but they will include a few mathematical calculations.
If you have the latest version of iCarousel , you can implement this more easily using the APIs. Add this method to your UIViewController (if you are using an example project, it might already be there, and you need to change it):
- (CGFloat)carousel:(iCarousel *)carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value { switch (option) { case iCarouselOptionFadeMin: return 0; case iCarouselOptionFadeMax: return 0; case iCarouselOptionFadeRange: return 2; default: return value; } }
You can replace 2 with a larger or smaller number to increase or decrease the opacity of the side views. For example, a value of 3 will make them less transparent. A value of 1.5 will make them more transparent. (A value of 1 will make them invisible.)
source share