开发者

xcode , iphone animation effect setAnimationPosition

开发者 https://www.devze.com 2023-03-17 17:58 出处:网络
is there any other method other than [UIView setAnimationPosition:CGPoint(0,0)]; i\'m implementing the \'suck effect\' but the effect keeps going to the top left hand corner .

is there any other method other than

[UIView setAnimationPosition:CGPoint(0,0)];

i'm implementing the 'suck effect' but the effect keeps going to the top left hand corner .

i want the effect to be 'sucked' to a specific position .

setAnimationPosition seems like the wa开发者_开发问答y but it isnt working / depreciated?


You can try this.

[UIView animateWithDuration:1 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{CGAffineTransform transform= CGAffineTransformMakeTranslation(170, 20);
        [myImage setTransform:transform];
    } completion:nil];

If you want to have a better effect add this to the code:

 CGAffineTransformMakeScale(myScale, myScale);

and use concat to join both the animations

CGAffineTransformConcat(scaleAnim, transform);
0

精彩评论

暂无评论...
验证码 换一张
取 消