objective c - iOS: why object turns to the start position after animation comletion -
)) I try to animate UIButton (two parallel animation: changing and moving images) after the animation button I should be transferred, but after completing the animation button it turns into a starting position. Please help fix it! thank you in advanced!
- (IBAction) Bug OnTapped: (ID) Sender {[UIView Animation with Disorganization: 1.0 Animation: ^ {self.bugOneButton.imageView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed: [UIImage ImageNamed: @ "bugOne2"], [UIImage imageNamed: @ "bugOne1"], [UIImage imageNamed: @ "bugOne2"], [UIImage imageNamed: @ "bugOne3"], [UIImage imageNamed: @ "BugOn4"], [ UIImage imageNamed: @ "bugOne5"], [UIImage imageNamed: @ "bugOne4"], zero]; Self.bugOneButton.imageView.animationDuration = 0.3; [Self.bugonebaton.image high-start permission]; Self.bugOneButton.center = CGAPXMake (auto.bugonoxexX, auto.bugonebatone.technas.A50); Self.bugOnePositionY = self.bugOnePositionY - 50; } Closing: ^ (BOOL Finish) {[self.bugOneButton.imageView stopAnimating]; }]; Self.bugOneButton.center = CP Pointsmake (self.bugOnePositionX, self.bugOnePositionY);
Remove the bottom line in your code
Self. BugOneButton.center = CP pointmake (self.bugOnePositionX, self.bugOnePositionY);
It will be fine ..
Comments
Post a Comment