Forum General

C# problem with ValueAnimator.

AndreyAndrianovAndreyAndrianov RUMember
edited April 2015 in General


I try to make timer using valueAnimator. I want that value increases every two seconds, but there is accelerating at the end, it means that at the beginning interval is 2 sec and after a while interval is a few milliseconds. Help me please.

ValueAnimator animator = ValueAnimator.OfInt (1, 1000);
animator.SetDuration (2000);
animator.Update += (object sender, ValueAnimator.AnimatorUpdateEventArgs e) =>
int newValue = (int) e.Animation.AnimatedValue;
text.Text = Convert.ToString(newValue);
P.S. Sorry for my English:)

Sign In or Register to comment.