I run an animation on my buttons where I change i.e. Opacity. When the animation is complete all the button’s Opacity goes back to initial values. The code:
CABasicAnimation animation = CABasicAnimation.FromKeyPath("opacity");
animation.To = NSNumber.FromFloat( 0.1f );
animation.Duration = animationDuration;
animation.TimingFunction = CAMediaTimingFunction.FromName (CAMediaTimingFunction.EaseOut);
How can I set the animation to stay in the To value?
I don’t see the error in the code, but there is another way to do that instead of
CoreAnimation, which is a bit verbose.For UIKit elements it is usually easier to use the
UIView.Animatemethod. So , your sample would be: