i am Displaying Images using iCarousel, and its display type is carousel.type = iCarouselTypeRotary;
all working fine but i need some changes in its displaying UI. I want to display only center view show original alpha and color with highlighted other nearest two view show dark. i did google but not fined any solution. please give me some suggestion or guide how to achieve this.
i explain this using Screenshot Bellow:-
After impliment iCarousel Displaying Images Like this:-
i want to display like nearest two images view of center imageview like bellow:-
please help me on this thank you .
There are various ways to achieve this. The carousel:itemAlphaForOffset:
answers you've already received are a good approach, but they'll involve doing a bit of maths.
If you have a recent version of iCarousel
, you can implement this more easily using the options API. Add this method to your UIViewController
(if you are using the example project it may already be in there and you'll need to modify 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 the 2 with a bigger 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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With