objective c - UIView continuous animation that repeats using a different frame iOS -
i doing animation on uiview , having repeat, working so:
[uiview animatewithduration:6.0f delay:0.0f options:uiviewanimationoptionrepeat | uiviewanimationoptioncurveeasein animations:^{ self.imgtopcloud.frame = cgrectmake(-self.imgtopcloud.frame.size.width, self.imgtopcloud.frame.origin.y, self.imgtopcloud.frame.size.width, self.imgtopcloud.frame.size.height); }completion:nil];
this animates outside of view's bounds. now, when that, want imgtopcloud
's frame start right @ end of view this:
//now start @ right self.imgtopcloud.frame = cgrectmake(self.view.frame.size.width, self.imgtopcloud.frame.origin.y, self.imgtopcloud.frame.size.width, self.imgtopcloud.frame.size.height);
the issue is, when animation starts repeat, brings imgtopcloud
's original starting frame, not new 1 want. tried putting new frame in completion block of animatewithduration
message, no dice.
any ideas?
don't repeat animation. instead, in completion block of animation, need 2 things.
1) set frame right
2) start repeating animation moves view left
Comments
Post a Comment