Ejemplo n.º 1
0
 /// <summary>
 /// Animates a fade-in where the view starts hidden and fades visible.
 /// </summary>
 /// <param name="view">The view to animate.</param>
 /// <param name="duration">The duration for the animation.</param>
 /// <param name="delay">An optional delay before starting the animation.</param>
 /// <param name="animationOptions">The animation options, the default is a cross dissolve transition.</param>
 public static void AnimateFadeIn(
     UIView view,
     double duration,
     double delay = 0,
     UIViewAnimationOptions animationOptions = UIViewAnimationOptions.TransitionCrossDissolve)
 {
     ViewAnimation.AnimateFadeIn(new[] { view }, duration, delay, animationOptions);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Animates a fade-in where the view starts hidden and fades visible.
        /// </summary>
        /// <param name="views">A list of views to animate.</param>
        /// <param name="duration">The duration for the animation.</param>
        /// <param name="delay">An optional delay before starting the animation.</param>
        /// <param name="animationOptions">The animation options, the default is a cross dissolve transition.</param>
        public static void AnimateFadeIn(
            IEnumerable <UIView> views,
            double duration,
            double delay = 0,
            UIViewAnimationOptions animationOptions = UIViewAnimationOptions.TransitionCrossDissolve)
        {
            if (delay > 0)
            {
                foreach (UIView view in views)
                {
                    view.Alpha = 0;
                }

                NSTimer.CreateScheduledTimer(delay, timer => ViewAnimation.AnimateFadeIn(views, duration, animationOptions));
            }
            else
            {
                ViewAnimation.AnimateFadeIn(views, duration, animationOptions);
            }
        }