Thursday, 15 August 2013

ios - CGRectOffset animation not working on ios8 but works on ios7 -



ios - CGRectOffset animation not working on ios8 but works on ios7 -

i have uiview moved via cgrectoffset in animatewithduration block when swipe detected. same view moves downwards same way when downwards swipe detected. when downwards swipe occurs , move downwards animation completes, phone call method animates uilabel shake left right. works on iphone 5 ios7, doesnt work on ios8. know why? i've heard cgrectoffset not working autolayout, doesn't explain why can work on ios7 , not ios8.

-(void) animateplaylabel { [uiview animatewithduration:1 delay:0 usingspringwithdamping:0.1 initialspringvelocity:0.2 options:uiviewanimationoptioncurveeaseinout animations:^{ self.playlabel.frame = cgrectoffset(self.playlabel.frame, -10, 0); self.playlabel.frame = cgrectoffset(self.playlabel.frame, +20, 0); self.playlabel.frame = cgrectoffset(self.playlabel.frame, -20, 0); self.playlabel.frame = cgrectoffset(self.playlabel.frame, +20, 0); self.playlabel.frame = cgrectoffset(self.playlabel.frame, -20, 0); self.playlabel.frame = cgrectoffset(self.playlabel.frame, +20, 0); self.playlabel.frame = cgrectoffset(self.playlabel.frame, -10, 0); } completion:^(bool finished) { }];

you should set final value of frame within uiview animation block. fact result want in ios 7 fluke - you're using api incorrectly.

it looks want label bounce around in place without moving. utilize uidynamics accomplish effect. (there's plenty of sample code out there.)

if want finer-grain command on effect, check out core animation's keyframe animations.

ios ios7 ios8 autolayout uiviewanimation

No comments:

Post a Comment