Exemple #1
0
        void applyMotionEffects()
        {
            if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1)
            {
                return;
            }

            UIInterpolatingMotionEffect horizontalEffect = new UIInterpolatingMotionEffect("center.x", UIInterpolatingMotionEffectType.TiltAlongHorizontalAxis);

            horizontalEffect.MinimumRelativeValue = new NSNumber(-kCustomIOS7MotionEffectExtent);
            horizontalEffect.MaximumRelativeValue = new NSNumber(kCustomIOS7MotionEffectExtent);

            UIInterpolatingMotionEffect verticalEffect = new UIInterpolatingMotionEffect("center.y", UIInterpolatingMotionEffectType.TiltAlongVerticalAxis);

            verticalEffect.MinimumRelativeValue = new NSNumber(-kCustomIOS7MotionEffectExtent);
            verticalEffect.MaximumRelativeValue = new NSNumber(kCustomIOS7MotionEffectExtent);

            UIMotionEffectGroup motionEffectGroup = new UIMotionEffectGroup();

            motionEffectGroup.MotionEffects = new UIMotionEffect[] { horizontalEffect, verticalEffect };

            DialogView.AddMotionEffect(motionEffectGroup);
        }