I apply the animation to the UIView object, the animation plays normally, but at the end the object becomes the same coordinates. Can someone know what's the matter?

var anim = CABasicAnimation.FromKeyPath("transform.translation.y"); anim.Duration = 1.0; anim.From = NSNumber.FromFloat(1); anim.To = NSNumber.FromFloat(100); anim.RepeatCount = 0; bookmarksView.Layer.AddAnimation(anim, "bmViewAnim"); 
  • C # for iOS? Maybe Objective-C? - angry
  • If Apple accepts applications compiled into native application code, then what's the point of moving to a new language? In general, the application was originally created in a week on Flex SDK 4.6 in Flash Builder, but on the ipad3 device, it fell and slowed down. MonoDevelop + MonoTouch + С # is completely free from such problems. True terms have grown to a couple of months, and this is not the limit. - ShockWave

1 answer 1

I don’t know whether it is a crutch or not, but I found the following method using the “scientific spear” method: set final animated properties before applying animation:

 bookmarksView.Layer.Position = new PointF(100, 100); // конечную позицию ставим заранее var anim = CABasicAnimation.FromKeyPath("position"); anim.Duration = 1.0; anim.To = NSValue.FromPointF(new PointF(100,100)); bookmarksView.Layer.AddAnimation(anim, "bmViewAnim");