nicklockwood / iCarousel

A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS
http://www.charcoaldesign.co.uk/source/cocoa#icarousel
Other
11.99k stars 2.58k forks source link

Width / height changed successfully, but Time Machine effect destroyed #872

Open aabantariqmurtaza opened 5 years ago

aabantariqmurtaza commented 5 years ago

Hi,

My Environment Each 'viewForItemAtIndex' is a view controller's view in my case. I am using Time Machine Style. Each Item have size = 500, 500. I override '(CGFloat)carouselItemWidth:(iCarousel *)carousel' method for width change.

My OutCome size of Items is successfully updated, but Time Machine style effect is destroyed.

Problem Time Machine Effect destroyed. see the snapshots please.

Snapshot In first snapshot, only one item is shown. in Second snapshot, other is also there but why its not appearing in first snapshot like time machine effect.

1_previousitemshidden 2

I will be very thankfull gentleman. please help.

aabantariqmurtaza commented 5 years ago

When i change each item size to 200, 200. Then Time Machine effect works correct.

nicklockwood commented 5 years ago

@aabantariqmurtaza this issue is that because the views are so large, the ones in front are obscuring the ones behind. You can correct for this by increasing the horizontal offset using iCarouselOptionTilt in the following delegate method:

- (CGFloat)carousel:(iCarousel *)carousel valueForOption:(iCarouselOption)option withDefault:(CGFloat)value
{
    switch (option)
    {
        case iCarouselOptionTilt:
        {
            return 1.0; // try different values between 0 and 1 to get the desired effect
        }
        default:
        {
            return value;
        }
    }
}
aabantariqmurtaza commented 5 years ago

I will check, and update here tomorrow. thank you so much for your help. @nicklockwood

aabantariqmurtaza commented 5 years ago

Thanks, I got the desired effect