iCarousel --> Delegate --> GetItemTransform --> Multiple Animations

AlexanderFreundAlexanderFreund USMember
edited January 2016 in Xamarin.iOS

Hello,

can anyone help me attach more than one animation to the items?

I dont get it to work.
Do anyone have a suggestion?

Here is my Code sample from

public override CoreAnimation.CATransform3D GetItemTransform (iCarousel carousel, nfloat offset, CoreAnimation.CATransform3D transform)
{

            nfloat centerItemZoom = 1.5f;
            nfloat centerItemSpacing = 1.23f;

            nfloat spacing = 1.0f;
            nfloat absClampedOffset = (nfloat)Math.Min(1.0f, Math.Abs(offset));
            nfloat clampedOffset =(nfloat) Math.Min(1.0f, Math.Max(-1.0f, offset));
            nfloat scaleFactor = 1.0f + absClampedOffset * (1.0f/centerItemZoom - 1.0f);
            offset = (scaleFactor * offset + scaleFactor * (centerItemSpacing + 1.0f) * clampedOffset) * carousel.ItemWidth * 3;

            if (carousel.Vertical)
            {
                transform = CoreAnimation.CATransform3D.MakeTranslation( 0.0f, offset, -absClampedOffset);
            }
            else
            {
                transform = CoreAnimation.CATransform3D.MakeTranslation( offset, 0.0f, -absClampedOffset);
            }

            transform = CoreAnimation.CATransform3D.MakeScale( scaleFactor, scaleFactor, 1.0f);
            return transform;




        }

Best Answer

Answers

Sign In or Register to comment.